[bug] [test-infra] TestStartSweeper_RecordsMetricsOnSuccess fails in full-suite (suite-state contamination) #86
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
internal/pendinguploads/TestStartSweeper_RecordsMetricsOnSuccesspasses when run in isolation but fails in the fullgo test ./...suite. Suite-state contamination from a sibling test (likely the sweeper goroutine outliving its test boundary, or a metrics counter not reset between tests).Repro
Reproduced on:
mainbranchmigrate/issue-71-vanity-importsbranchIdentical failure on both, confirming this predates the migration.
Suspected mechanism
pendinguploads.StartSweeperreturns afunc()shutdown hook. If a prior test in the same package fails to call its shutdown hook, the sweeper goroutine keeps running with stale state — including the prometheus counter the assertion test checks.The fix shape is one of:
StartSweeperwith a fresh ticker channel + asserts on a returned channel (vs polling a shared metric).init()ort.Cleanup).testify/requirewith a small backoff on the assertion to absorb the timing — tolerable but doesn't fix the root cause.Recommend (1).
Class
Pre-existing test brittleness. Filed during the post-internal#71 test sweep on operator host. NOT a regression.
Out of scope
internal#71 (Go module path migration) does not touch this code.
Reporter
Discovered during full-suite testing of the molecule-core vanity-import migration on operator host (
5.78.80.188). 2026-05-07.