about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-12-05 01:07:30 +0000
committerEric Wong <normalperson@yhbt.net>2012-12-05 01:11:44 +0000
commitb7be1a6897e8a699211690e9bb9114a2d0a69d54 (patch)
treedd2a403f2af1f669f26f56a3910f1ce0ac83515e
parentef7bd6492102c02abe175d2adb81b8566e697bac (diff)
downloadcmogstored-b7be1a6897e8a699211690e9bb9114a2d0a69d54.tar.gz
This avoids a race condition where a child dies after the parent
is reaped by us.
-rw-r--r--test/cmogstored-cfg.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/cmogstored-cfg.rb b/test/cmogstored-cfg.rb
index 369779e..aee4187 100644
--- a/test/cmogstored-cfg.rb
+++ b/test/cmogstored-cfg.rb
@@ -370,6 +370,14 @@ class TestCmogstoredConfig < Test::Unit::TestCase
     _, status = Process.waitpid2(@pid)
     assert status.success?, status.inspect
     pids.each do |pid|
+      100.times do
+        begin
+          Process.kill(0, pid)
+          sleep 0.1
+        rescue Errno::ESRCH
+          break
+        end
+      end
       assert_raises(Errno::ESRCH) { Process.kill(0, pid) }
     end
   end