mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 18:43:59 +02:00
On FreeBSD, threads don't die on daemon(3)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
30ce930f37
commit
843f3a6564
1 changed files with 13 additions and 1 deletions
|
@ -1492,7 +1492,19 @@ class TestProcess < Test::Unit::TestCase
|
||||||
assert_equal(2, data.size, bug4920)
|
assert_equal(2, data.size, bug4920)
|
||||||
assert_not_include(data.map(&:to_i), pid)
|
assert_not_include(data.map(&:to_i), pid)
|
||||||
end
|
end
|
||||||
else
|
elsif /freebsd/ =~ RUBY_PLATFORM
|
||||||
|
def test_daemon_no_threads
|
||||||
|
data = Timeout.timeout(3) do
|
||||||
|
IO.popen("-") do |f|
|
||||||
|
break f.readlines.map(&:chomp) if f
|
||||||
|
th = Thread.start {sleep 3}
|
||||||
|
Process.daemon(true, true)
|
||||||
|
puts Thread.list.size, th.status.inspect
|
||||||
|
end
|
||||||
|
end
|
||||||
|
assert_equal(["2", "\"run\""], data)
|
||||||
|
end
|
||||||
|
else # darwin
|
||||||
def test_daemon_no_threads
|
def test_daemon_no_threads
|
||||||
data = Timeout.timeout(3) do
|
data = Timeout.timeout(3) do
|
||||||
IO.popen("-") do |f|
|
IO.popen("-") do |f|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue