From eaa7cdea79beea04a298e95abb4a6a2d1d89a626 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 31 Aug 2026 03:34:51 +0200 Subject: [PATCH] Check the provider applied before reading what its file says The mesh withdrawing a route and the machine acting on it are different things, and a test that reads the file without checking the second reports the first wrongly whenever the machine is behind for any unrelated reason. On failure it now also prints what the mesh would send now, which is what separates 'the mesh still thinks this contributes' from 'the machine never applied'. --- test/integration/mesh.test.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/integration/mesh.test.ts b/test/integration/mesh.test.ts index 1e47d38..07d604d 100644 --- a/test/integration/mesh.test.ts +++ b/test/integration/mesh.test.ts @@ -941,9 +941,19 @@ test("a route is a grant: a workload is reached by the name it asked for", { await mesh("push"); await new Promise((r) => setTimeout(r, 20_000)); + // The provider has to have applied before the file means anything. **The mesh withdrawing a + // route and the machine acting on it are different things**, and a test that reads the file + // without checking the second reports the first wrongly whenever the machine is behind for any + // unrelated reason. + const applied = await mesh("status"); + assert.doesNotMatch(applied, /anchor\s+(failed|refused)/, + `the provider did not apply, so what its file says is not what the mesh decided:\n${applied}`); + const after = await must("anchor", `cat /etc/frontdoor/routes.json`); assert.doesNotMatch(after, /shop\.mesh\.test/, - `the route outlived the module that asked for it:\n${after}`); + `the route outlived the module that asked for it:\n${after}\n\n` + + `what the mesh would send now:\n` + + `${(await on("anchor", `docker exec mesh-control /mesh-control plan anchor --files`)).out}`); let gone = false; for (let i = 0; i < 15 && !gone; i++) {