2007-12-21 03:38:16 -05:00
|
|
|
assert_equal '0', %q{
|
2007-12-21 16:35:08 -05:00
|
|
|
begin
|
|
|
|
GC.stress = true
|
|
|
|
pid = fork {}
|
|
|
|
Process.wait pid
|
|
|
|
$?.to_i
|
|
|
|
rescue NotImplementedError
|
|
|
|
0
|
|
|
|
end
|
2007-12-21 03:38:16 -05:00
|
|
|
}, '[ruby-dev:32404]'
|
2009-02-17 20:49:17 -05:00
|
|
|
|
|
|
|
assert_finish 10, %q{
|
2009-02-26 00:02:21 -05:00
|
|
|
begin
|
|
|
|
children = (1..10).map{
|
|
|
|
Thread.start{fork{}}.value
|
|
|
|
}
|
|
|
|
while !children.empty? and pid = Process.wait
|
|
|
|
children.delete(pid)
|
|
|
|
end
|
|
|
|
rescue NotImplementedError
|
2009-02-17 20:49:17 -05:00
|
|
|
end
|
|
|
|
}, '[ruby-core:22158]'
|
2009-06-07 19:59:58 -04:00
|
|
|
|
|
|
|
assert_normal_exit(<<'End', '[ruby-dev:37934]')
|
|
|
|
Thread.new { sleep 1; Thread.kill Thread.main }
|
|
|
|
Process.setrlimit(:NPROC, 1)
|
|
|
|
fork {}
|
|
|
|
End
|