mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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:
parent
98ac3f1fe4
commit
d0b5f31554
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue