summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-06 01:06:45 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-06 01:06:45 +0000
commit0de0e14ddecf00bca2e8de7115e8c619e2e1e46b (patch)
treea0a7c5c0773efef640afeab2948ce1b22cf9ff92 /test
parent4b7fd61a05aff71d5044f985ac3c7924bed9e403 (diff)
* test/ruby/test_optimization.rb (test_tailcall_interrupted_by_sigint):
don't use sleep to run faster. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_optimization.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb
index c035a112cb..2589494596 100644
--- a/test/ruby/test_optimization.rb
+++ b/test/ruby/test_optimization.rb
@@ -328,18 +328,21 @@ eval <<EOF
def foo
foo
end
+puts("start")
+STDOUT.flush
foo
EOF
EOS
- err = EnvUtil.invoke_ruby([], "", true, true, {}) {
+ status, err = EnvUtil.invoke_ruby([], "", true, true, {}) {
|in_p, out_p, err_p, pid|
in_p.write(script)
in_p.close
- sleep(1)
+ out_p.gets
Process.kill(:SIGINT, pid)
- Process.wait(pid)
- err_p.read
+ *, stat = Process.wait2(pid)
+ [stat, err_p.read]
}
+ assert_equal(Signal.list["INT"], status.termsig)
assert_match(/Interrupt/, err, bug)
end