o11ygin: fix flaky TestClientCancelled/cancel timer assertion - #1450
Open
circleci-app[bot] wants to merge 2 commits into
Open
o11ygin: fix flaky TestClientCancelled/cancel timer assertion#1450circleci-app[bot] wants to merge 2 commits into
circleci-app[bot] wants to merge 2 commits into
Conversation
The subtest asserted an exact handler timer of ~100ms, but the value depends on when the server sees the client-side cancel. Under CI load the handler can observe the cancel tens of ms earlier, exceeding the 15ms tolerance provided by CMPMetrics and failing the test. Match the pattern used elsewhere in this file (line 139) and ignore the Value field for the comparison. Presence of the timer entry with the expected Name/Tags is what the test actually cares about. AI-Generated: true
renovate
Bot
force-pushed
the
renovate/github.com-jackc-pgx-v5-5.x
branch
2 times, most recently
from
July 17, 2026 16:14
904d34a to
c515060
Compare
renovate
Bot
force-pushed
the
renovate/github.com-jackc-pgx-v5-5.x
branch
2 times, most recently
from
August 12, 2026 03:31
0488f27 to
40d4939
Compare
renovate
Bot
force-pushed
the
renovate/github.com-jackc-pgx-v5-5.x
branch
2 times, most recently
from
August 14, 2026 21:29
bced0e7 to
38bc8aa
Compare
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
TestClientCancelled/cancelasserts an exactValue: 100.344581for thehandlertimer metric. TheCMPMetricscomparator only allows ~15ms of slack viaEquateApprox, but the handler's observed duration depends on when the server sees the client-side cancel and can vary by tens of ms under CI load. In the failing job the handler saw the cancel at 63.79ms — well outside the 15ms tolerance.The rest of the file already handles this pattern (see line 139) by passing
cmpopts.IgnoreFields(fakemetrics.MetricCall{}, "Value", "ValueInt")alongsideCMPMetrics. This change applies the same approach — but only ignoresValue, so theValueInt: 1warning-count assertion is preserved.Test plan
go test -run TestClientCancelled -count=3 -race -v ./o11y/wrappers/o11ygin/passes locally 3× in a rowRun task