summaryrefslogtreecommitdiff
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
parent4b7fd61a05aff71d5044f985ac3c7924bed9e403 (diff)
downloadruby-0de0e14ddecf00bca2e8de7115e8c619e2e1e46b.tar.gz
* 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
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_optimization.rb11
2 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7f72c3004c..239d380afe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Nov 6 10:03:00 2016 Shugo Maeda <shugo@ruby-lang.org>
+
+ * test/ruby/test_optimization.rb (test_tailcall_interrupted_by_sigint):
+ don't use sleep to run faster.
+
Sun Nov 6 09:58:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* process.c (rb_exec_fillarg): honor the given path environment
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