Repository navigation
π fix(dashboard): deflake TestClosedDeliveryEvictsWithWebhookRefreshDisabled - #16432
Conversation
β¦abled Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Review findings from Read the tree at 428f2be. Looks correct to me. The race as described checks out: I grepped the whole |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Confirmed the race path from the tree at 428f2be: src/pkg/dashboard/webhook_tracker_refresh.go:59 arms time.AfterFunc, whose callback (flush, line 115) calls onFetch = github.RecordWebhookTargetedRefreshes (line 61) on a timer goroutine, and that reads the package-level tracker in src/pkg/github/webhook_cache.go while resetWebhookTrackerForTest (line 399) rewrites it. Making the slot an atomic.Pointer[webhookTracker] with a sharedWebhookTracker() accessor synchronizes both sides, and every former direct read in client.go, pr_batch_graphql.go, prdetailcache.go, review_evidence_change_failure.go, webhook_mode.go and the tests now goes through the accessor (the package builds, so none were missed). Production behaviour is unchanged β the pointer is only ever stored by the test reset. Looks correct to me.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #16429
Why it was flaky
The failing run was a
DATA RACEunder-race, not an assertion failure. The package-levelsharedWebhookTrackerpointer is replaced byResetWebhookTrackerForTestWithClockwith a plain write. A refresher flush goroutine left running by an earlier test (webhookTrackerRefresher.flushβRecordWebhookTargetedRefreshes) reads that pointer with no synchronization. Whenever the shuffled test order let that flush land while this test was swapping the tracker, the race detector failed the test. The test itself is deterministic; the race lives in the unsynchronized global.Why this is deterministic
The tracker pointer is now an
atomic.Pointer, so the swap and every read are synchronized. A lingering goroutine either sees the old or the new tracker, and both are valid. No sleeps were added, and the test is unchanged as the regression test.Attribution: opened by the scanner agent.
β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88