The two-node bed waits for the anchor's first apply before its filter

This commit is contained in:
2026-10-02 16:46:16 +02:00
parent 7914fd74c6
commit 1e5b509129
+8 -1
View File
@@ -338,7 +338,14 @@ test("both machines join it, and the token is all they need", { skip, timeout: 9
await mesh("assign anchor networking");
await must("anchor", `pgrep -x mesh-host >/dev/null || (nohup ${HOST_PATH} run > /var/log/mesh-host.log 2>&1 & sleep 3)`);
await mesh("push anchor");
await new Promise((r) => setTimeout(r, 8000));
// The host reports which of its links face outside with every apply, and the filter is not
// composed for a machine that has not — so its first apply is waited for, not slept past.
const appliedBy = Date.now() + 180_000;
while (!(await on("anchor", `grep -q 'applied [0-9]' /var/log/mesh-host.log`)).ok) {
if (Date.now() > appliedBy) assert.fail(`the anchor never applied what it was sent:\n${(await on("anchor", "tail -30 /var/log/mesh-host.log")).out}`);
await new Promise((r) => setTimeout(r, 3000));
}
await new Promise((r) => setTimeout(r, 5000));
await deriveTheFilterOn({ machine: "anchor", node: "anchor", hubPort: 51820, must, mesh, on });
// **The laptop makes its tunnel key, and the token is issued for it.** The hub is told the key