Repository navigation
Keep a receipt test's late recovery out of the next test's telemetry - #2376
Merged
Merged
Conversation
TestRecoveredReceiptAddsOnlyPreviouslyMissingTokens settled its second generation with no billing sink, so the client fetched its receipt in the background. The test ended first, and that one late row landed in the next test's spool, which made TestOverflowUsageNamesTheActualAttemptRoute see three rows. Arm the billing sink the comment assumes, and check the second settle queues no receipt. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Summary
TestOverflowUsageNamesTheActualAttemptRoutesometimes saw three telemetry rows instead of two, but only when the wholeinternal/providerpackage ran. It never failed alone.The extra row came from the test before it,
TestRecoveredReceiptAddsOnlyPreviouslyMissingTokens. That test's second settle had usage but no billing sink, so the client fetched the generation's receipt in the background. The test read its spool and ended before the receipt arrived, and the row then landed in the next test's spool. The two rows from the overflow call itself were never doubled.The earlier test now arms the billing sink its own comment assumes, and checks that the second settle queues no receipt. The overflow test is unchanged.
This changes no product code. Without a billing sink, the client still records that call once, through its receipt.
Validation
Whole
internal/providerpackage, four processes at once:The rows caught in both failures matched the earlier test's
generation-two. The new check fails before the fix, with 2 receipts queued.🤖 Generated with Claude Code