Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ruby/lib/ci/queue/redis/build_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def record_success(id, stats: nil, skip_flaky_record: false, acknowledge: true)
error_reports_deleted_count, requeued_count, _ = redis.pipelined do |pipeline|
pipeline.hdel(key('error-reports'), id)
pipeline.hget(key('requeues-count'), id)
pipeline.sadd(key('success-reports'), id)
pipeline.expire(key('success-reports'), config.redis_ttl)
record_stats(stats, pipeline: pipeline)
end
record_flaky(id) if !skip_flaky_record && (error_reports_deleted_count.to_i > 0 || requeued_count.to_i > 0)
Expand Down
14 changes: 14 additions & 0 deletions ruby/lib/ci/queue/redis/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ def poll
pipeline.expire(key('worker', worker_id, 'queue'), config.redis_ttl)
pipeline.expire(key('processed'), config.redis_ttl)
end

# check we executed all tests
# only the master should perform this check because otherwise we will DDoS Redis when all workers
# try to fetch the processed tests at the same time
if master? && exhausted?
executed_tests = (redis.smembers(key('success-reports')) + redis.hkeys(key('error-reports')))
missing_tests = @index.keys - executed_tests

if missing_tests.size > 0
puts "ci-queue did not process all tests!"
puts missing_tests
report_worker_error(StandardError.new("ci-queue did not process all tests!"))
end
end
rescue *CONNECTION_ERRORS
end

Expand Down
Loading