Skip to content

Commit d0b5f31

Browse files
committed
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. ```
1 parent 98ac3f1 commit d0b5f31

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/ruby/test_thread_queue.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,14 @@ def test_thr_kill
235235
end
236236
_eom
237237
rescue Timeout::Error
238+
# record load average:
239+
uptime = `uptime` rescue nil
240+
if uptime && /(load average: [\d.]+),/ =~ uptime
241+
la = " (#{$1})"
242+
end
243+
238244
count = File.read("#{d}/test_thr_kill_count").to_i
239-
flunk "only #{count}/#{total_count} done in #{timeout} seconds."
245+
flunk "only #{count}/#{total_count} done in #{timeout} seconds.#{la}"
240246
end
241247
}
242248
end

0 commit comments

Comments
 (0)