diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-07-26 06:32:49 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-07-26 06:32:49 +0000 |
commit | 317b979e29774a77fb933c4f42514ff007669b39 (patch) | |
tree | 084b2214d85b687f537ab52b26f63188a62dc6a4 | |
parent | 596dbef8b4b23657fd78dca4bc55e261c3f6b376 (diff) | |
download | cmogstored-317b979e29774a77fb933c4f42514ff007669b39.tar.gz |
Unfortunately, slow mount points still cause minor reliability issues with the test suite.
-rw-r--r-- | test/mgmt.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/mgmt.rb b/test/mgmt.rb index 7c650b8..c3c6a66 100644 --- a/test/mgmt.rb +++ b/test/mgmt.rb @@ -328,7 +328,7 @@ class TestMgmt < Test::Unit::TestCase end until line == ".\n" end - assert lines.grep(/\b#{max}\b/)[0], lines.inspect + assert lines.grep(/\b#{max}\b/)[0], swarn(lines.inspect) assert_nil lines.grep(/\b#{max + 1}\b/)[0] assert File.exist?("#@tmpdir/dev#{max}/usage") assert ! File.exist?("#@tmpdir/dev#{max + 1}/usage") @@ -346,7 +346,7 @@ class TestMgmt < Test::Unit::TestCase break if str =~ /^666\t/ end util = RUBY_PLATFORM =~ /linux/ ? %r{\d+\.\d\d} : %r{\d+(?:\.\d+)?} - assert_match(/^666\t#{util}\n/, str) + assert_match(/^666\t#{util}\n/, str, swarn(str.inspect)) assert_equal ".\n", @client.gets end if `which iostat 2>/dev/null`.chomp.size != 0 && RUBY_PLATFORM !~ /kfreebsd-gnu/ @@ -362,14 +362,18 @@ class TestMgmt < Test::Unit::TestCase lines = [] lines << @client.gets lines << @client.gets - assert_match(/^(666|999)\t#{util}\n/, lines[0]) - assert_match(/^(666|999)\t#{util}\n/, lines[1]) + assert_match(/^(666|999)\t#{util}\n/, lines[0], swarn(lines.inspect)) + assert_match(/^(666|999)\t#{util}\n/, lines[1], swarn(lines.inspect)) assert_not_equal(lines[0], lines[1]) assert_equal ".\n", @client.gets end if `which iostat 2>/dev/null`.chomp.size != 0 && RUBY_PLATFORM !~ /kfreebsd-gnu/ + def swarn(str) + "#{str} slow mountpoints increases the chance of this test failing" + end + def sparse_file_prepare(big = nil) Dir.mkdir("#@tmpdir/dev666") if nil == big |