diff options
Diffstat (limited to 'bootstraptest/test_fork.rb')
| -rw-r--r-- | bootstraptest/test_fork.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bootstraptest/test_fork.rb b/bootstraptest/test_fork.rb index 9e64f1d026..860ef285d0 100644 --- a/bootstraptest/test_fork.rb +++ b/bootstraptest/test_fork.rb @@ -84,14 +84,19 @@ assert_equal 'ok', %q{ 10.times do pid = fork{ exit!(0) } - deadline = now + 1 - until Process.waitpid(pid, Process::WNOHANG) + deadline = now + 10 + while true + _, status = Process.waitpid2(pid, Process::WNOHANG) + break if status if now > deadline Process.kill(:KILL, pid) raise "failed" end sleep 0.001 end + unless status.success? + raise "child exited with status #{status}" + end rescue NotImplementedError end :ok |
