record load average at fail

On a high load machine, the following test can fail.
This patch simply records the load average with `uptime`.

```
  1) Failure:
TestThreadQueue#test_thr_kill [/tmp/ruby/src/trunk_gcc10/test/ruby/test_thread_queue.rb:239]:
only 165/250 done in 60 seconds.
```
This commit is contained in:
Koichi Sasada 2025-06-08 04:24:56 +09:00
parent 98ac3f1fe4
commit d0b5f31554

View File

@ -235,8 +235,14 @@ class TestThreadQueue < Test::Unit::TestCase
end
_eom
rescue Timeout::Error
# record load average:
uptime = `uptime` rescue nil
if uptime && /(load average: [\d.]+),/ =~ uptime
la = " (#{$1})"
end
count = File.read("#{d}/test_thr_kill_count").to_i
flunk "only #{count}/#{total_count} done in #{timeout} seconds."
flunk "only #{count}/#{total_count} done in #{timeout} seconds.#{la}"
end
}
end