summaryrefslogtreecommitdiff
path: root/test/ruby/test_process.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-10 15:36:06 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-10 15:36:06 +0000
commit843f3a656476d2620c2b228eae58f2812832e485 (patch)
treead56ce5843b78e7cba2a314c4f42dfd13aad4596 /test/ruby/test_process.rb
parent30ce930f375583d0a3d5663bfb6a7717b4dff1e4 (diff)
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
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r--test/ruby/test_process.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index bfe58457d7..226e348156 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1492,7 +1492,19 @@ class TestProcess < Test::Unit::TestCase
assert_equal(2, data.size, bug4920)
assert_not_include(data.map(&:to_i), pid)
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
data = Timeout.timeout(3) do
IO.popen("-") do |f|