Current is not caught up
settled() returned the moment a declaration was current, because the sent digest is recorded at send — so both new tests asserted on a machine still applying, and found containers not created yet and bindings not written. The eternal-waiting fault had been standing in front of this gap the whole time; fixing it is what let the tests get far enough to fall in. Caught up now means the machine's own last report is newer than what was sent to it — two timestamps the mesh recorded itself, read from the `reported` section status now carries. The residual latency between "reported" and "every container answers" stays with the tests' own polls, where it always was.
This commit is contained in:
@@ -135,6 +135,7 @@ async function settled(node: string, withinMs = 240_000): Promise<void> {
|
|||||||
wrong: { node: string; outcome: string; refused?: string;
|
wrong: { node: string; outcome: string; refused?: string;
|
||||||
failed?: { id: string; error: string }[] }[];
|
failed?: { id: string; error: string }[] }[];
|
||||||
waiting: { node: string; never: boolean }[];
|
waiting: { node: string; never: boolean }[];
|
||||||
|
reported: { node: string; outcome: string; at?: string; sent?: string }[];
|
||||||
} | undefined;
|
} | undefined;
|
||||||
let said = "";
|
let said = "";
|
||||||
try {
|
try {
|
||||||
@@ -160,7 +161,15 @@ async function settled(node: string, withinMs = 240_000): Promise<void> {
|
|||||||
.filter(Boolean).join("\n ");
|
.filter(Boolean).join("\n ");
|
||||||
throw new Error(`${node} did not apply what it was sent (${bad.outcome}):\n ${why}`);
|
throw new Error(`${node} did not apply what it was sent (${bad.outcome}):\n ${why}`);
|
||||||
}
|
}
|
||||||
if (!state.waiting.some((w) => w.node === node)) return;
|
// Current is not caught up. The sent digest is recorded at send, so "not waiting" holds
|
||||||
|
// from the moment push returns, while the machine is still applying — this test asserted on
|
||||||
|
// containers the instant the declaration was current and found them not created yet. Caught
|
||||||
|
// up is the machine's own report being newer than what was sent to it: two timestamps the
|
||||||
|
// mesh recorded itself, compared.
|
||||||
|
const word = state.reported.find((r) => r.node === node);
|
||||||
|
const acted = word?.outcome === "applied" && !!word.at && !!word.sent &&
|
||||||
|
Date.parse(word.at) > Date.parse(word.sent);
|
||||||
|
if (!state.waiting.some((w) => w.node === node) && acted) return;
|
||||||
last = said;
|
last = said;
|
||||||
// Unhurried on purpose: each poll is an exec into a container on the machine that is busy
|
// Unhurried on purpose: each poll is an exec into a container on the machine that is busy
|
||||||
// applying, and asking four times a minute rather than thirty is the difference between
|
// applying, and asking four times a minute rather than thirty is the difference between
|
||||||
|
|||||||
Reference in New Issue
Block a user