A build-log bus test waits for the stream to store both lines (hq issue 507) #236

Merged
mesh-admin merged 1 commits from fix/507-a-build-log-test-waits into main 2026-10-11 19:12:48 +00:00
Contributor

Fixes novox/hq issue 507 (a controller bus test fails at times: the build's log stream holds one message where it wants two).

Cause. natsBuild.Say publishes a log line with a plain core publish. The server delivers it to a live subscriber and stores it in the EVENTS stream independently. The test received both lines on its subscription, then read StreamInfo once; under load the stream had stored only one line, or none yet.

Fix. The test now polls the stream's per-subject count for up to 5 s (10 ms steps) and fails only if it does not reach 2 in that time. A dead if err == nil {} went with it. Test only; no production code changes.

Not a fault, and not changed: the repeated could not read whether b-1 was cancelled, so it is built: nats: no responders line. The test bus never creates the build seat's cancelled set (only queue_test.go raises it), so the direct get has no responder on every run, and the holder takes its documented fallback (build it). It happens on every run, passing or failing, and adds no log line.

Proof. Ran 16 copies of the -race test binary at once, -count=50 each, with every CPU busy:

  • before: 10 of 800 runs failed at builds_nats_test.go:132 (5 with the stream holding 1 line, 5 with it holding 0)
  • after: 0 of 800 failed

Also go test -run TestNatsABuildIsTakenAndItsOutcomeReachesEverybody -count=200 ./internal/link/ passes, and so do go vet ./internal/link/ and go test ./internal/link/.

Fixes novox/hq issue 507 (a controller bus test fails at times: the build's log stream holds one message where it wants two). **Cause.** `natsBuild.Say` publishes a log line with a plain core publish. The server delivers it to a live subscriber and stores it in the EVENTS stream independently. The test received both lines on its subscription, then read `StreamInfo` once; under load the stream had stored only one line, or none yet. **Fix.** The test now polls the stream's per-subject count for up to 5 s (10 ms steps) and fails only if it does not reach 2 in that time. A dead `if err == nil {}` went with it. Test only; no production code changes. **Not a fault, and not changed:** the repeated `could not read whether b-1 was cancelled, so it is built: nats: no responders` line. The test bus never creates the build seat's cancelled set (only `queue_test.go` raises it), so the direct get has no responder on every run, and the holder takes its documented fallback (build it). It happens on every run, passing or failing, and adds no log line. **Proof.** Ran 16 copies of the `-race` test binary at once, `-count=50` each, with every CPU busy: - before: 10 of 800 runs failed at builds_nats_test.go:132 (5 with the stream holding 1 line, 5 with it holding 0) - after: 0 of 800 failed Also `go test -run TestNatsABuildIsTakenAndItsOutcomeReachesEverybody -count=200 ./internal/link/` passes, and so do `go vet ./internal/link/` and `go test ./internal/link/`.
mesh-admin added 1 commit 2026-10-11 19:05:17 +00:00
Wait for the build's log lines to be stored before counting them (hq issue 507)
mesh/merge-gate pass: the change touches no module of the mesh's graph
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery delivered
8d73f705af
A line is said with a plain publish, so a live subscriber can hold both
lines while the stream has stored one or none yet; the test read the
stream once and failed under load. It now waits up to 5 s for both.
Author
Contributor

Delivery novox/mesh-controller@8d73f705afb9 — delivered since 2026-10-11T19:13:16Z

Delivery plan — builds nothing: the change touches no module of the mesh's graph

Transitions

  • 2026-10-11 19:05 (new) → proposed (announced): novox/mesh-controller#236's head announced
  • 2026-10-11 19:10 proposed → checked (checked): the verdict names this commit
  • 2026-10-11 19:10 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail
  • 2026-10-11 19:13 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move
  • 2026-10-11 19:13 published → delivered (done): nothing for a walk to move

The commit's note under refs/notes/mesh-plan keeps every transition: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-controller@8d73f705afb9` — **delivered** since 2026-10-11T19:13:16Z **Delivery plan** — builds nothing: the change touches no module of the mesh's graph **Transitions** - 2026-10-11 19:05 (new) → proposed (announced): novox/mesh-controller#236's head announced - 2026-10-11 19:10 proposed → checked (checked): the verdict names this commit - 2026-10-11 19:10 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail - 2026-10-11 19:13 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move - 2026-10-11 19:13 published → delivered (done): nothing for a walk to move The commit's note under `refs/notes/mesh-plan` keeps every transition: `git log --notes=mesh-plan`.
mesh-admin merged commit 92aa3fb179 into main 2026-10-11 19:12:48 +00:00
mesh-admin deleted branch fix/507-a-build-log-test-waits 2026-10-11 19:12:50 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-controller#236