Skip to content

test: diagnose stuck counters in eventcounter experiment result waits - #2737

Merged
cre8ivejp merged 1 commit into
mainfrom
test/eventcounter-diagnose-stuck-counts
Jul 30, 2026
Merged

test: diagnose stuck counters in eventcounter experiment result waits#2737
cre8ivejp merged 1 commit into
mainfrom
test/eventcounter-diagnose-stuck-counts

Conversation

@cre8ivejp

Copy link
Copy Markdown
Member

TestGrpcExperimentResult hung in the dev cluster, logging "waiting for linked users A=50/50 B=50/50" until the suite timed out. The readiness check requires all eight counters (evaluation and goal event/user counts for both variations) to match exactly, but the retry log only printed the two goal user counts, hiding which counter was actually stuck.

Now the retry log prints all eight counters. Additionally, when an event count exceeds the expected total, the test fails immediately with a clear message: DWH rows are append-only, so an over-count (events persisted more than once due to at-least-once Pub/Sub redelivery) can never converge back, and burning the remaining retries only delays the failure until the 10-minute suite panic that kills the other tests.

TestGrpcExperimentResult hung in the dev cluster logging
"waiting for linked users A=50/50 B=50/50" until the suite timed out.
The readiness check requires all eight counters (evaluation and goal
event/user counts for both variations) to match exactly, but the retry
log only printed the two goal user counts, hiding which counter was
actually stuck.

Now the retry log prints all eight counters. Additionally, when an event
count exceeds the expected total the test fails immediately with a clear
message: DWH rows are append-only, so an over-count (events persisted
more than once due to at-least-once Pub/Sub redelivery) can never
converge back, and burning the remaining retries only delays the failure
until the 10-minute suite panic that kills the other tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings July 30, 2026 14:39
@cre8ivejp
cre8ivejp marked this pull request as ready for review July 30, 2026 14:39
@cre8ivejp
cre8ivejp requested review from hvn2k1 and t-kikuc as code owners July 30, 2026 14:39
@cre8ivejp
cre8ivejp merged commit d9b0aaf into main Jul 30, 2026
11 checks passed
@cre8ivejp
cre8ivejp deleted the test/eventcounter-diagnose-stuck-counts branch July 30, 2026 14:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Improves debuggability and failure behavior of the TestGrpcExperimentResult e2e wait loop by making retry logs show the full set of per-variation counters and by failing fast on non-recoverable over-count scenarios (append-only DWH).

Changes:

  • Add helper to format and log all four counters (evaluation + goal, events + users) per variation during retries.
  • Add a fast-fail check when counters exceed the expected totals to avoid burning retries until suite timeout.
  • Update the retry log message to include all counters for both variations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +2335 to +2348
for _, v := range variations {
if v.vr.EvaluationCount != nil && v.vr.EvaluationCount.EventCount > n {
t.Fatalf("variation %s: evaluation event count %d exceeds the expected %d: "+
"events were likely persisted more than once (duplicate Pub/Sub delivery); "+
"this can never recover, failing fast",
v.name, v.vr.EvaluationCount.EventCount, n)
}
if v.vr.ExperimentCount != nil && v.vr.ExperimentCount.EventCount > n {
t.Fatalf("variation %s: goal event count %d exceeds the expected %d: "+
"events were likely persisted more than once (duplicate Pub/Sub delivery); "+
"this can never recover, failing fast",
v.name, v.vr.ExperimentCount.EventCount, n)
}
}
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