diff options
author | Koichi Sasada <[email protected]> | 2025-06-08 04:24:56 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2025-06-08 04:24:56 +0900 |
commit | d0b5f3155406e8243b78e4cedd3a38710c7c323c (patch) | |
tree | e77c31c991724927a6ea56cb8b454ec57f6c211e /test/ruby | |
parent | 98ac3f1fe451789c2676956d09cdda6dee78f947 (diff) |
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.
```
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_thread_queue.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/ruby/test_thread_queue.rb b/test/ruby/test_thread_queue.rb index 545bf98888..9485528977 100644 --- a/test/ruby/test_thread_queue.rb +++ b/test/ruby/test_thread_queue.rb @@ -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 |