Broker tests read a consumer's pending count through pendingOf wherever they expect a count after a publish (issue 1126) #477

Merged
mesh-tools merged 1 commits from fix/1126-tests-wait-for-consumer-counts into main 2026-10-26 22:58:00 +00:00
Member

Issue 1126 (L2: the try of main after tonight's unchecked merges).

What failed. A try of main b611f737 on ace (try-1793053180291110296, 2026-10-26 22:24 UTC) failed internal/broker.TestAResetOfTheEventsConsumerLeavesTheMergesAndTheirConsumerAlone: the merges consumer held 0 pending right after the merge's publish was acknowledged. It passed 30 of 30 runs on an idle workstation; ace was running four tries at once. The server (nats-server v2.11.17) counts a consumer's pending after it acknowledges the publish, so a read at once races it.

Change, for the kind. All six reads of a positive pending count after a publish in internal/broker (controller_buckets_integration_test.go x3, consumer_from_now_test.go x2, modstreams_live_test.go x1) go through the package's own pendingOf, whose deadline rises from 1 s to 10 s. Reads that expect 0 stay direct: a lag cannot fail them. internal/link already waits through its own helper. Tests only; no controller code changes.

Quick or thorough. Quick would be the one named test; chosen: every read of that kind in the repository (fix-a-bug-met-twice), since the verdict names only the first failure.

Research 'The controller, NATS-native': none; this changes tests only, not a part of the controller.

Checked locally. go vet -tags integration ./internal/broker/ clean; the changed tests pass (3 runs); the whole untagged unit suite passes.

Reviewed-by: review-tries@shanks at 8d58afea6c

Issue 1126 (L2: the try of main after tonight's unchecked merges). **What failed.** A try of main b611f737 on ace (try-1793053180291110296, 2026-10-26 22:24 UTC) failed `internal/broker.TestAResetOfTheEventsConsumerLeavesTheMergesAndTheirConsumerAlone`: the merges consumer held 0 pending right after the merge's publish was acknowledged. It passed 30 of 30 runs on an idle workstation; ace was running four tries at once. The server (nats-server v2.11.17) counts a consumer's pending after it acknowledges the publish, so a read at once races it. **Change, for the kind.** All six reads of a positive pending count after a publish in internal/broker (controller_buckets_integration_test.go x3, consumer_from_now_test.go x2, modstreams_live_test.go x1) go through the package's own `pendingOf`, whose deadline rises from 1 s to 10 s. Reads that expect 0 stay direct: a lag cannot fail them. internal/link already waits through its own helper. Tests only; no controller code changes. **Quick or thorough.** Quick would be the one named test; chosen: every read of that kind in the repository (fix-a-bug-met-twice), since the verdict names only the first failure. **Research 'The controller, NATS-native':** none; this changes tests only, not a part of the controller. **Checked locally.** go vet -tags integration ./internal/broker/ clean; the changed tests pass (3 runs); the whole untagged unit suite passes. Reviewed-by: review-tries@shanks at 8d58afea6cb87144abedbf586452532eca260534
mesh-tools added 1 commit 2026-10-26 22:30:42 +00:00
Broker tests read a consumer's pending count through pendingOf, which waits up to 10 s, wherever they expect a count after a publish (issue 1126)
mesh/delivery merged: source.main moved to novox/mesh-controller@2dafbe60e939
mesh/check being carried to 8d58afea6cb8 on 2dafbe60e939 | from b611f7375a47
8d58afea6c
The server counts a consumer's pending after it acknowledges the publish, so a read at once failed the try of
main on a loaded ace (TestAResetOfTheEventsConsumerLeavesTheMergesAndTheirConsumerAlone, 2026-10-26 22:24 UTC).
Fixed for the kind, not the one test: all six reads of a positive count go through the package's own pendingOf,
whose deadline was 1 s.

Research 'The controller, NATS-native': none; this changes tests only, not a part of the controller.
Author
Member

Delivery novox/mesh-controller@8d58afea6cb8 — merged since 2026-10-26T22:58:00Z

Source — source.main moved to novox/mesh-controller@2dafbe60e9. Whether it reached the machines is mesh-delivery-view's, derived from source.main, the wants and the haves.

Transitions

  • 2026-10-26 22:30 (new) → proposed (announced): novox/mesh-controller#477's head announced
  • 2026-10-26 22:30 proposed → ready (accepted): a verdict names this commit and the trunk's head as its trunk commit, the gate passed or warned, and the repository's own check did not fail; or the check gates no merge (check-gates-merge false)
  • 2026-10-26 22:58 ready → merged (merged): on the trunk its modules follow: merged there

The commit's note under refs/notes/mesh-plan keeps every transition of this change up to its merge: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-controller@8d58afea6cb8` — **merged** since 2026-10-26T22:58:00Z **Source** — source.main moved to novox/mesh-controller@2dafbe60e939. Whether it reached the machines is `mesh-delivery-view`'s, derived from `source.main`, the wants and the haves. **Transitions** - 2026-10-26 22:30 (new) → proposed (announced): novox/mesh-controller#477's head announced - 2026-10-26 22:30 proposed → ready (accepted): a verdict names this commit and the trunk's head as its trunk commit, the gate passed or warned, and the repository's own check did not fail; or the check gates no merge (check-gates-merge false) - 2026-10-26 22:58 ready → merged (merged): on the trunk its modules follow: merged there The commit's note under `refs/notes/mesh-plan` keeps every transition of this change up to its merge: `git log --notes=mesh-plan`.
mesh-tools merged commit 2dafbe60e9 into main 2026-10-26 22:58:00 +00:00
mesh-tools deleted branch fix/1126-tests-wait-for-consumer-counts 2026-10-26 22:58:02 +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-controller#477