Skip to content

test: synchronize notifications fuse fixture - #789

Merged
frahlg merged 1 commit into
masterfrom
agent/fix-notifications-test-race
Aug 4, 2026
Merged

frahlg merged 1 commit into
masterfrom
agent/fix-notifications-test-race

Conversation

@frahlg

@frahlg frahlg commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Synchronize the asynchronous fuse-over-limit test with its HealthTick worker.
  • Replace fixed sleeps and polling with explicit evaluation and publish signals.

Root cause

Service.Subscribe runs evaluateFuse in a goroutine. The test's FuseReader closure read the local l1 value while the test goroutine wrote it, producing the race reported at service_test.go:524, 561, 566. The race is confined to the test fixture; production code is unchanged.

Validation

  • go test -race ./internal/notifications -run '^TestFuseOverLimitFiresAfterThresholdAndResets$' -count=20
  • go test -race ./internal/notifications -count=1
  • make verify
  • pre-commit make verify
  • pre-push make verify-all

No changeset is included because this is test-only.

@frahlg frahlg added the no-changeset PR intentionally exempt from the changeset requirement (dev tooling / non-shipping) label Aug 4, 2026 — with ChatGPT Codex Connector
@frahlg
frahlg force-pushed the agent/fix-notifications-test-race branch from 6140d5c to a4d6ca4 Compare August 4, 2026 12:44
@frahlg
frahlg marked this pull request as ready for review August 4, 2026 12:46
@frahlg
frahlg merged commit 980b247 into master Aug 4, 2026
13 checks passed
@frahlg
frahlg deleted the agent/fix-notifications-test-race branch August 7, 2026 08:14
frahlg added a commit that referenced this pull request Oct 17, 2026
* ci: run the Go race detector on the control-loop packages

CI runs go test without -race. Agents report "race tests pass" from
local runs, and two races still merged: #787 and #789 fixed test fakes
that raced after landing. On their parent commits (ee416d1, 5d5f810)
this check fails with WARNING: DATA RACE.

.github/scripts/race.sh runs -race on the 16 package trees that share
state with the control loop. The same command runs locally and in the
new race job, which the required go test + vet check now waits for.
All of them pass on master today.

* ci: skip the wall-clock retention budget test under -race

The race detector slows code 5-10x, so the 3-second retention budget in
TestForecastRetentionLargeOverflowWithinScoringBudget failed on CI with
no data race. The plain test job still enforces the budget.

* ci: exercise race script edits in Core checks

Signed-off-by: Fredrik Ahlgren <[email protected]>

---------

Signed-off-by: Fredrik Ahlgren <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changeset PR intentionally exempt from the changeset requirement (dev tooling / non-shipping)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant