Skip to content

Commit 5cb40fa

Browse files
committed
Check we executed all tests
1 parent 7665161 commit 5cb40fa

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

ruby/lib/ci/queue/redis/worker.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,19 @@ def poll
5555
sleep 0.05
5656
end
5757
end
58+
59+
# check we executed all tests
60+
# only the master should perform this check because otherwise we will DDoS Redis when all workers
61+
# try to fetch the processed tests at the same time
62+
if master?
63+
missing_tests = @index.keys - redis.smembers(key('processed'))
64+
puts "missing_tests: #{missing_tests.size}"
65+
if exhausted? && missing_tests.size > 0
66+
puts "We have not processed all tests!"
67+
puts missing_tests.inspect
68+
end
69+
end
70+
5871
redis.pipelined do |pipeline|
5972
pipeline.expire(key('worker', worker_id, 'queue'), config.redis_ttl)
6073
pipeline.expire(key('processed'), config.redis_ttl)

0 commit comments

Comments
 (0)