[前][次][番号順一覧][スレッド一覧]

ruby-changes:51547

From: mame <ko1@a...>
Date: Wed, 27 Jun 2018 22:58:46 +0900 (JST)
Subject: [ruby-changes:51547] mame:r63757 (trunk): Revert "bootstraptest/runner: speed up assert_finish by avoiding sleep"

mame	2018-06-27 11:37:26 +0900 (Wed, 27 Jun 2018)

  New Revision: 63757

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63757

  Log:
    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

  Modified files:
    trunk/bootstraptest/runner.rb
Index: bootstraptest/runner.rb
===================================================================
--- bootstraptest/runner.rb	(revision 63756)
+++ bootstraptest/runner.rb	(revision 63757)
@@ -373,18 +373,13 @@ def assert_finish(timeout_seconds, tests https://github.com/ruby/ruby/blob/trunk/bootstraptest/runner.rb#L373
     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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]