about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-11-14 21:05:14 +0000
committerEric Wong <normalperson@yhbt.net>2012-11-14 21:05:14 +0000
commitb615dd35ac805176cd1284145b0c0a75f2ce5554 (patch)
tree1ea71d94838dbd6a7a22059f7963b173939e2e66
parent41327689fb727843de258ec99145b78631f821a6 (diff)
downloadcmogstored-b615dd35ac805176cd1284145b0c0a75f2ce5554.tar.gz
This test failed badly on multi-core machines.
-rw-r--r--test/mgmt.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/mgmt.rb b/test/mgmt.rb
index 5c0807c..f224068 100644
--- a/test/mgmt.rb
+++ b/test/mgmt.rb
@@ -276,13 +276,13 @@ class TestMgmt < Test::Unit::TestCase
     assert_match(%r{ERROR: unknown command}, @client.gets)
     taskdir = "/proc/#@pid/task"
     glob = "#{taskdir}/*"
+    nr_threads = Dir[glob].size if File.directory?(taskdir)
     @client.write "server aio_threads = 1\r\n"
     assert_equal "\r\n", @client.gets
     if RUBY_PLATFORM =~ /linux/
       assert File.directory?(taskdir), "/proc not mounted on Linux?"
     end
     if File.directory?(taskdir)
-      nr_threads = Dir[glob].size
       while nr_threads == Dir[glob].size && (tries -= 1) > 0
         sleep(0.1)
       end