mesh/merge-gate head 0d2686b5ebee merged into trunk 4b8e7f11cf53 — pass: builds gitea → novox; no bus step; every machine composes with the change as it di…
mesh/repo-check head 0d2686b5ebee merged into trunk 4b8e7f11cf53 — pass: its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-…
mesh/delivery delivered
mesh/check failed: unit: fixture/beside.TestReadsTheSiblingBesideIt: beside_test.go:17: open /var/lib/mesh-build-go-work/mvip9ircc11d3c/beside/sibling…
34 lines
1.4 KiB
TypeScript
34 lines
1.4 KiB
TypeScript
// **A consumer that cannot be bound yet is bound again** (novox/hq issue 1793): the runtime's "no responders" at the
|
|
// bundle's start, seen 2026-10-22 00:28:37 on mesh-catalog#427's verdict, ended the bundle and the verdict was never
|
|
// written on the forge.
|
|
|
|
import { test } from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
import { bindUntilHeld, bindWait } from "../dist/bind.js";
|
|
|
|
test("a bind refused with no responders is asked again until it holds, and says so", async () => {
|
|
let calls = 0;
|
|
const waits: number[] = [];
|
|
const said: string[] = [];
|
|
await bindUntilHeld("mesh-controller.checked", async () => {
|
|
calls++;
|
|
if (calls < 4) throw new Error("binding gitea's consumer novox_gitea: nats: no responders available for request");
|
|
}, async (ms) => { waits.push(ms); }, (l) => said.push(l));
|
|
assert.equal(calls, 4);
|
|
assert.deepEqual(waits, [2_000, 5_000, 10_000]);
|
|
assert.equal(said.length, 4);
|
|
assert.match(said[0], /no responders available for request.*asking again in 2s/);
|
|
assert.match(said[3], /is bound after 4 attempts/);
|
|
});
|
|
|
|
test("a bind that holds the first time says nothing and waits for nothing", async () => {
|
|
const said: string[] = [];
|
|
await bindUntilHeld("x", async () => {}, async () => assert.fail("waited"), (l) => said.push(l));
|
|
assert.deepEqual(said, []);
|
|
});
|
|
|
|
test("the wait grows to 30 s and stays", () => {
|
|
assert.deepEqual([1, 2, 3, 4, 50].map(bindWait), [2_000, 5_000, 10_000, 30_000, 30_000]);
|
|
});
|