summaryrefslogtreecommitdiff
path: root/bootstraptest/test_fork.rb
blob: 6a34d9b4ae32d0056c0621e30ea5ca7225871368 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
assert_equal '0', %q{
  begin
    GC.stress = true
    pid = fork {}
    Process.wait pid
    $?.to_i
  rescue NotImplementedError
    0
  end
}, '[ruby-dev:32404]'

assert_finish 10, %q{
  children = (1..10).map{
    Thread.start{fork{}}.value
  }
  while !children.empty? and pid = Process.wait
    children.delete(pid)
  end
}, '[ruby-core:22158]'