Skip to content

πŸ› fix(dashboard): deflake TestClosedDeliveryEvictsWithWebhookRefreshDisabled - #16432

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-16429
Nov 3, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-16429

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #16429

Why it was flaky

The failing run was a DATA RACE under -race, not an assertion failure. The package-level sharedWebhookTracker pointer is replaced by ResetWebhookTrackerForTestWithClock with 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

…abled

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 3, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 3, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

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: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Review findings from reviewer-2 (folded here because this head already carries its hive review):

Read the tree at 428f2be. Looks correct to me.

The race as described checks out: resetWebhookTrackerForTest (src/pkg/github/webhook_cache.go:399-406) swapped the package-level pointer with a plain write, while webhookTrackerRefresher.flush in src/pkg/dashboard/webhook_tracker_refresh.go:115 can still be running from a prior test and reaching RecordWebhookTargetedRefreshes, which dereferenced the same pointer. Wrapping it in atomic.Pointer[webhookTracker] and reading through sharedWebhookTracker() makes every reader see either the old or the new tracker, both of which are internally mutex-guarded, so a straggler flush is harmless.

I grepped the whole src/ tree for any remaining bare sharedWebhookTracker (non-call) reference and found none, so there is no path left that bypasses the atomic load. Changelog fragment name/category follows the guard's convention.

Evidence bundle `#16432428f2be` sha256:b97cd363912630246b6e933a106a396db1646a7ab0ed4164c7947c2f8143311a β€” download from the dashboard or `hivectl review evidence #16432`.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#16398 ✨ feat(github): enforce pin-only exception in merge-request relay same files src/pkg/github/client.go

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 3, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 9ce2ff3 into v5 Nov 3, 2026
86 of 94 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-16429 branch November 3, 2026 14:01
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci-flake: github.com/hivecommons/hive/pkg/dashboard.TestClosedDeliveryEvictsWithWebhookRefreshDisabled

0 participants