mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_signal.rb (TestSignal#test_exit_action): use spawn
instead of fork. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d1a4390eed
commit
acff965a5f
2 changed files with 10 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Mon Aug 9 22:11:09 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* test/ruby/test_signal.rb (TestSignal#test_exit_action): use
|
||||||
|
Process.spawn instead of Process.fork.
|
||||||
|
|
||||||
Mon Aug 9 15:59:02 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
Mon Aug 9 15:59:02 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* lib/rubygems/source_index.rb: rename unused variable.
|
* lib/rubygems/source_index.rb: rename unused variable.
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
require 'timeout'
|
require 'timeout'
|
||||||
|
require_relative 'envutil'
|
||||||
|
|
||||||
class TestSignal < Test::Unit::TestCase
|
class TestSignal < Test::Unit::TestCase
|
||||||
def have_fork?
|
def have_fork?
|
||||||
|
@ -40,13 +41,14 @@ class TestSignal < Test::Unit::TestCase
|
||||||
begin
|
begin
|
||||||
r, w = IO.pipe
|
r, w = IO.pipe
|
||||||
r0, w0 = IO.pipe
|
r0, w0 = IO.pipe
|
||||||
pid = Process.fork {
|
pid = Process.spawn(EnvUtil.rubybin, '-e', <<-'End', 3=>w, 4=>r0)
|
||||||
|
w = IO.new(3, "w")
|
||||||
|
r0 = IO.new(4, "r")
|
||||||
Signal.trap(:USR1, "EXIT")
|
Signal.trap(:USR1, "EXIT")
|
||||||
w0.close
|
|
||||||
w.syswrite("a")
|
w.syswrite("a")
|
||||||
Thread.start { sleep(2) }
|
Thread.start { sleep(2) }
|
||||||
r0.sysread(4096)
|
r0.sysread(4096)
|
||||||
}
|
End
|
||||||
r.sysread(1)
|
r.sysread(1)
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
assert_nothing_raised("[ruby-dev:26128]") {
|
assert_nothing_raised("[ruby-dev:26128]") {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue