diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-07-12 00:42:55 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-07-12 00:46:31 +0000 |
commit | 56d4a65df3fc011086648563b2235eac49b7ba60 (patch) | |
tree | 87d0761b10abb1b102eccddf8626a133473e190f | |
parent | f206fc4ee27546c57ebc6b4bf069257c05970cd2 (diff) | |
download | cmogstored-56d4a65df3fc011086648563b2235eac49b7ba60.tar.gz |
Without this, test_iostat_watch fails sometimes under valgrind.
-rw-r--r-- | test/mgmt.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/mgmt.rb b/test/mgmt.rb index b94dd8a..041d13d 100644 --- a/test/mgmt.rb +++ b/test/mgmt.rb @@ -325,11 +325,16 @@ class TestMgmt < Test::Unit::TestCase def test_iostat_watch Dir.mkdir("#@tmpdir/dev666") @client.write "watch\n" + str = nil # wait for iostat to catch up - 2.times { assert_kind_of String, @client.gets } + 10.times do + str = @client.gets + assert_kind_of String, str + break if str =~ /^666\t/ + end util = RUBY_PLATFORM =~ /linux/ ? %r{\d+\.\d\d} : %r{\d+(?:\.\d+)?} - assert_match(/^666\t#{util}\n/, @client.gets) + assert_match(/^666\t#{util}\n/, str) assert_equal ".\n", @client.gets end if `which iostat 2>/dev/null`.chomp.size != 0 && RUBY_PLATFORM !~ /kfreebsd-gnu/ |