Close the test bus only after the enrolment stand-in has removed its consumer, so the next test can subscribe (issue 604) #122

Merged
mesh-tools merged 2 commits from fix/604-the-enrolment-stand-in-unbinds into main 2026-10-20 05:57:07 +00:00
Member

Fixes issue 604 (a node-engine bus test failing now and then with "consumer is already bound to a subscription").

Cause: in internal/link/asking_nats_test.go, asking() registered t.Cleanup(a.Close), and natsAsking.Close closes the shared test connection. Cleanups run last-in first-out and theMeshAnswers registers first, so the stand-in's Unsubscribe met a closed connection; nats.go v1.54 then returns ErrConnectionClosed before deleting the consumer it created, and the durable consumer stayed on CONTROL, a workqueue stream that allows one consumer per filter. The next test was refused whenever the server had not yet dropped the dead interest.

Fix, tests only: asking()'s cleanup unsubscribes its answers alone and the bus helper closes the connection last; the stand-in uses a durable name per test and, before subscribing and after unsubscribing, deletes it and waits until the server says it is gone (5 s bound, fails at once on a closed connection). Production code is unchanged.

Try build-1792460090148788027 passed (internal/link fresh, 10.9 s); the first attempt at a9789b51 failed and showed the real cause.

Reviewed-by: review-604@shanks at d6f8b00bf8

Fixes issue 604 (a node-engine bus test failing now and then with "consumer is already bound to a subscription"). Cause: in internal/link/asking_nats_test.go, asking() registered t.Cleanup(a.Close), and natsAsking.Close closes the shared test connection. Cleanups run last-in first-out and theMeshAnswers registers first, so the stand-in's Unsubscribe met a closed connection; nats.go v1.54 then returns ErrConnectionClosed before deleting the consumer it created, and the durable consumer stayed on CONTROL, a workqueue stream that allows one consumer per filter. The next test was refused whenever the server had not yet dropped the dead interest. Fix, tests only: asking()'s cleanup unsubscribes its answers alone and the bus helper closes the connection last; the stand-in uses a durable name per test and, before subscribing and after unsubscribing, deletes it and waits until the server says it is gone (5 s bound, fails at once on a closed connection). Production code is unchanged. Try build-1792460090148788027 passed (internal/link fresh, 10.9 s); the first attempt at a9789b51 failed and showed the real cause. Reviewed-by: review-604@shanks at d6f8b00bf822989477fbc6268cebbdc43b4d1b4f
mesh-tools added 2 commits 2026-10-20 01:37:05 +00:00
The stand-in shared one durable name across tests and let go with Unsubscribe alone, so a test starting before the server dropped the binding was refused with "consumer is already bound to a subscription".
Do not let the asking's Close shut the stand-in's connection before its cleanup (issue 604)
mesh/merge-gate head d6f8b00bf822 merged into trunk 2474bf28330f — pass: the change touches no module of the mesh's graph
mesh/repo-check head d6f8b00bf822 merged into trunk 2474bf28330f — pass: its merge-check.sh passed
mesh/delivery delivered
d6f8b00bf8
The asking helper registered a.Close, which closes the shared test connection; the stand-in's cleanup ran after it on a closed connection, so its consumer was never deleted and blocked the next test on the workqueue stream.
Author
Member

Delivery novox/mesh-host@d6f8b00bf822 — delivered since 2026-10-20T05:57:10Z

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

Transitions

  • 2026-10-20 01:37 (new) → proposed (announced): novox/mesh-host#122's head announced
  • 2026-10-20 01:38 proposed → checked (checked): a verdict names this commit and the trunk's head as its trunk commit
  • 2026-10-20 01:38 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail
  • 2026-10-20 05:57 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move
  • 2026-10-20 05:57 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-host@d6f8b00bf822` — **delivered** since 2026-10-20T05:57:10Z **Delivery plan** — builds nothing: the change touches no module of the mesh's graph **Transitions** - 2026-10-20 01:37 (new) → proposed (announced): novox/mesh-host#122's head announced - 2026-10-20 01:38 proposed → checked (checked): a verdict names this commit and the trunk's head as its trunk commit - 2026-10-20 01:38 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail - 2026-10-20 05:57 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move - 2026-10-20 05:57 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-tools merged commit 619e14aa8e into main 2026-10-20 05:57:07 +00:00
mesh-tools deleted branch fix/604-the-enrolment-stand-in-unbinds 2026-10-20 05:57:07 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-host#122