about summary refs log tree commit homepage
path: root/test/mgmt.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/mgmt.rb')
-rw-r--r--test/mgmt.rb9
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/