From 83419916e5933f99ebac05787582d326de05584d Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Mon, 10 Feb 2025 15:21:34 +0000 Subject: [PATCH] wip --- ruby/lib/ci/queue/redis/worker.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ruby/lib/ci/queue/redis/worker.rb b/ruby/lib/ci/queue/redis/worker.rb index f8910698..19c198a0 100644 --- a/ruby/lib/ci/queue/redis/worker.rb +++ b/ruby/lib/ci/queue/redis/worker.rb @@ -60,12 +60,19 @@ def poll # 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? + executed_tests = (redis.smembers(key('success-reports')) + redis.hkeys(key('error-reports'))).map { |id| id.dup.force_encoding(Encoding::BINARY) } + ids = @index.keys.map { |id| id.dup.force_encoding(Encoding::BINARY) } + missing_tests = ids - executed_tests - if exhausted? && - (missing_tests = @index.keys - (redis.smembers(key('success-reports')) + redis.hkeys(key('error-reports')))) && - missing_tests.size > 0 + if exhausted? && missing_tests.size > 0 puts "ci-queue did not process all tests!" + puts "------- all tests" + puts ids.inspect + puts "------- executed tests" + puts executed_tests.inspect + puts "------- missing tests" puts missing_tests.inspect + puts "--------------------------------" end end