Skip to content

Commit 928f0b2

Browse files
committed
Only increment counts when we acknowledge
1 parent 3de93c6 commit 928f0b2

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎ruby/lib/ci/queue/redis/build_record.rb‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,13 @@ def record_warning(type, attributes)
5757
end
5858

5959
def record_error(id, payload, stats: nil)
60-
acknowledged, _ = redis.pipelined do |pipeline|
61-
@queue.acknowledge(id, error: payload, pipeline: pipeline)
62-
record_stats(stats, pipeline: pipeline)
63-
end
60+
acknowledged = @queue.acknowledge(id, error: payload)
6461

65-
@queue.increment_test_failed if acknowledged == 1
62+
if acknowledged
63+
# if another worker already acknowledged the test, we don't need to update the global stats or increment the test failed count
64+
record_stats(stats)
65+
@queue.increment_test_failed
66+
end
6667
nil
6768
end
6869

0 commit comments

Comments
 (0)