summaryrefslogtreecommitdiff
path: root/tool/lib/test
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2022-04-05 19:23:38 +0900
committerKazuhiro NISHIYAMA <zn@mbf.nifty.com>2022-04-05 19:23:38 +0900
commitd9c6f8d45c658121dcabb2e26cddb473e907d724 (patch)
tree232e32bb8db2e8ec4e85d6e29e0617184f23405c /tool/lib/test
parent573005983af9d3d1cfd3ad7251dad9855f3be552 (diff)
Try to fix NoMethodError on slow environments
``` 1) Failure: TestParallel::TestParallel#test_hungup [/home/user/ruby/tool/test/testunit/test_parallel.rb:215]: Expected /^Retrying hung up testcases\.+$/ to match "Run options: \n" + " --seed=43403\n" + " --ruby\n" + " \"./miniruby -I../lib -I. -I.ext/common ../tool/runruby.rb --extout=.ext -- --disable-gems\"\n" + " -j\n" + " t1\n" + " --worker-timeout=1\n" + "\n" + "# Running tests:\n" + "\n" + "/home/user/ruby/tool/lib/test/unit.rb:687:in `block in _run_parallel': undefined method `<' for nil:NilClass (NoMethodError)\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:538:in `block in quit_workers'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:537:in `reject!'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:537:in `quit_workers'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:687:in `_run_parallel'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:810:in `_run_suites'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:849:in `_run_suites'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:1479:in `_run_anything'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:1263:in `_run_anything'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:1654:in `run_tests'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:1641:in `block in _run'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:1640:in `each'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:1640:in `_run'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:1682:in `run'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:1034:in `run'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:882:in `run'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:154:in `run'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:1761:in `run'\n" + "\tfrom /home/user/ruby/tool/lib/test/unit.rb:1765:in `run'\n" + "\tfrom /home/user/ruby/tool/test/testunit/tests_for_parallel/runner.rb:14:in `<main>'\n". ```
Diffstat (limited to 'tool/lib/test')
-rw-r--r--tool/lib/test/unit.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb
index 0c752c0fa7..cca75520d0 100644
--- a/tool/lib/test/unit.rb
+++ b/tool/lib/test/unit.rb
@@ -684,7 +684,7 @@ module Test
if !(_io = IO.select(@ios, nil, nil, timeout))
timeout = Time.now - @worker_timeout
- quit_workers {|w| w.response_at < timeout}&.map {|w|
+ quit_workers {|w| w.response_at&.<(timeout) }&.map {|w|
rep << {file: w.real_file, result: nil, testcase: w.current[0], error: w.current}
}
elsif _io.first.any? {|io|