test: diagnose stuck counters in eventcounter experiment result waits - #2737
Merged
Conversation
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>
There was a problem hiding this comment.
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) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.