test(paidtool): de-flake postpaid metering (fixes intermittent CI failure)#35
Open
boymak wants to merge 1 commit into
Open
test(paidtool): de-flake postpaid metering (fixes intermittent CI failure)#35boymak wants to merge 1 commit into
boymak wants to merge 1 commit into
Conversation
…per bound CI run 28174117576 failed on "postpaid metering › charges based on actual execution metrics" (expected true, actual false). The handler sleeps 50ms and the test asserted the metered charge was < $0.15 (i.e. duration < 150ms) — a tight upper bound that flakes on slow/loaded CI runners where the real duration can spike past 150ms (GC, scheduler, cold runner). The failure is non- deterministic and unrelated to the change under test; re-runs and the merge build passed. Keep the meaningful lower bound (≥ $0.05 ⇒ ≥50ms of metered work) and replace the flaky upper bound with an exact check that the charge equals durationMs * rate — which actually proves "charges based on actual metrics" without depending on wall-clock speed. Full suite: 247 passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Why
CI run 28174117576 failed on
postpaid metering › charges based on actual execution metrics(expected true, actual false). It's a flaky, timing-dependent assertion — not a real regression: re-runs and every merge build passed, somainis green.The handler sleeps 50ms and meters
durationMs × $0.001. The test assertedamount < 0.15(i.e. duration < 150ms). On a slow/loaded CI runner the real duration can spike past 150ms (GC, scheduler, cold runner) → the upper bound fails.Fix
≥ $0.05⇒ ≥50ms of metered work —setTimeoutnever fires early, so this is safe).amount === durationMs × rate, which actually proves "charges based on actual metrics" without depending on wall-clock speed.Full suite: 247 passing. No production code touched.
Note (non-blocking)
CI also logs a warning that
actions/checkout@v4/actions/setup-node@v4target Node 20 (deprecated, forced to Node 24). Worth bumping the actions in a follow-up, but it's just a warning, not the failure.🤖 Generated with Claude Code