Skip to content

Only increment counts when we acknowledge#372

Open
ChrisBr wants to merge 2 commits intomainfrom
cbruckmayer/only-increment-on-ack
Open

Only increment counts when we acknowledge#372
ChrisBr wants to merge 2 commits intomainfrom
cbruckmayer/only-increment-on-ack

Conversation

@ChrisBr
Copy link
Contributor

@ChrisBr ChrisBr commented Feb 6, 2026

When a test times out and gets executed by another worker and then worker 1 succeeds and worker 2 fails we will acknowledge the success (and ignore the failure). However, we do still count failure in the global counter which can cause some confusion in the log output.

Just to clarify, the overall build result is correct, just the log output is confusing.

acknowledged, _ = redis.pipelined do |pipeline|
@queue.acknowledge(id, error: payload, pipeline: pipeline)
record_stats(stats, pipeline: pipeline)
acknowledged = @queue.acknowledge(id, error: payload)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChrisBr Do we still need to move the counting to after recording?

if test.requeued?
          self.requeues += 1
        elsif test.skipped?
          self.skips += 1
        elsif test.error?
          self.errors += 1
        elsif test.failure
          self.failures += 1
        end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because we only count on acknowledge. Counting / success requeue always is fine, errors are problematic.

record_stats(stats, pipeline: pipeline)
acknowledged = @queue.acknowledge(id, error: payload)
if acknowledged == 1
record_stats(stats)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only record stats on failure if this worker actually acknowledged

@ChrisBr ChrisBr force-pushed the cbruckmayer/only-increment-on-ack branch from a6ae8cb to 3f3dd19 Compare February 6, 2026 16:58
@ChrisBr ChrisBr force-pushed the cbruckmayer/only-increment-on-ack branch from 3f3dd19 to 928f0b2 Compare February 6, 2026 17:00
record_stats(stats)
@queue.increment_test_failed
else
record_stats({"ignored" => 1})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love just updating ignored but it should be fine.

if acknowledged
record_stats(stats)
else
record_stats({"ignored" => 1})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love just updating ignored but it should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants