File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -50,10 +50,22 @@ def master?
50
50
51
51
def poll
52
52
wait_for_master
53
+ idle_since = nil
54
+ idle_state_printed = false
53
55
until shutdown_required? || config . circuit_breakers . any? ( &:open? ) || exhausted? || max_test_failed?
54
56
if test = reserve
57
+ idle_since = nil
55
58
yield index . fetch ( test )
56
59
else
60
+ idle_since ||= Time . now
61
+ if Time . now - idle_since > 120 && !idle_state_printed
62
+ puts "Worker #{ worker_id } has been idle for 120 seconds. Printing global state..."
63
+ puts " Processed tests: #{ redis . scard ( key ( 'processed' ) ) } "
64
+ puts " Pending tests: #{ redis . llen ( key ( 'queue' ) ) } . #{ redis . lrange ( key ( 'queue' ) , 0 , -1 ) } "
65
+ puts " Running tests: #{ redis . zcard ( key ( 'running' ) ) } . #{ redis . zrange ( key ( 'running' ) , 0 , -1 ) } "
66
+ puts " Owners: #{ redis . hgetall ( key ( 'owners' ) ) } "
67
+ idle_state_printed = true
68
+ end
57
69
sleep 0.05
58
70
end
59
71
end
You can’t perform that action at this time.
0 commit comments