summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-27 02:37:26 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-27 02:37:26 +0000
commite3e22c551d24829e0f9ce84afd3653867582034b (patch)
tree2da6f87af1b7f187707814b37c25601b50225c0a /bootstraptest
parent529af9c82123393c73f74040d974558b68212297 (diff)
Revert "bootstraptest/runner: speed up assert_finish by avoiding sleep"
This reverts commit r63754. Many CI servers still use old ruby as base ruby which does not support read_nonblock. https://rubyci.org/logs/www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/log/20180627T013100Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rwxr-xr-xbootstraptest/runner.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index 29dfef771a..e807ce5b62 100755
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -373,18 +373,13 @@ def assert_finish(timeout_seconds, testsrc, message = '')
io = IO.popen("#{@ruby} -W0 #{filename}")
pid = io.pid
waited = false
- tlimit = Process.clock_gettime(Process::CLOCK_MONOTONIC) + timeout_seconds
- diff = timeout_seconds
- while diff > 0
+ tlimit = Time.now + timeout_seconds
+ while Time.now < tlimit
if Process.waitpid pid, Process::WNOHANG
waited = true
break
end
- if IO.select([io], nil, nil, diff)
- while String === io.read_nonblock(1024, exception: false)
- end
- end
- diff = tlimit - Process.clock_gettime(Process::CLOCK_MONOTONIC)
+ sleep 0.1
end
if !waited
Process.kill(:KILL, pid)