From 9e54433b92c70ab80cadde792554d7151173abb9 Mon Sep 17 00:00:00 2001 From: Kit <344842+roodboi@users.noreply.github.com> Date: Sat, 14 Nov 2026 07:29:26 +0000 Subject: [PATCH 1/2] test(lifecycle): keep shared-helper rollback fixture ports distinct --- tests/project-shared-helpers.test.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/project-shared-helpers.test.ts b/tests/project-shared-helpers.test.ts index 881abbff0..daf39421c 100644 --- a/tests/project-shared-helpers.test.ts +++ b/tests/project-shared-helpers.test.ts @@ -404,10 +404,22 @@ test( async () => { const root = await scratch(); const first = helperConfig({ port: freePort() }); + + // Branch A already holds the first helper from an earlier successful up. + await startProjectSharedHelpers({ + ...context(root), + helpers: [first], + composeProject: BRANCH_A, + }); + const owned = await ownedIdentity(root, first); + + // Keep the first port bound while selecting the second: two closed bind + // probes can return the same port, making the foreign fixture look adoptable. const second = helperConfig({ port: freePort(), name: "second-bridge", }); + expect(second.port).not.toBe(first.port); // The second port is held by a different helper kind (foreign). const other = await startForeign({ root, @@ -415,14 +427,6 @@ test( port: second.port, }); - // Branch A already holds the first helper from an earlier successful up. - await startProjectSharedHelpers({ - ...context(root), - helpers: [first], - composeProject: BRANCH_A, - }); - const owned = await ownedIdentity(root, first); - // Branch B's up acquires the first helper, then the second is refused: // B's new holder on the first helper is rolled back. const failedUp = startProjectSharedHelpers({ From 0fbd6852fe275c3e59857b5134b9f60062bd2c1c Mon Sep 17 00:00:00 2001 From: Kit <344842+roodboi@users.noreply.github.com> Date: Sat, 14 Nov 2026 07:43:54 +0000 Subject: [PATCH 2/2] test(lifecycle): identify unexpected shared-helper claim kind --- tests/project-shared-helpers.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/project-shared-helpers.test.ts b/tests/project-shared-helpers.test.ts index daf39421c..ce2db58e8 100644 --- a/tests/project-shared-helpers.test.ts +++ b/tests/project-shared-helpers.test.ts @@ -167,7 +167,9 @@ async function readHelperClaim( async function ownedIdentity(root: string, helper: ProjectSharedHelperConfig) { const claim = await readHelperClaim(root, helper); if (claim?.ownership !== "owned") { - throw new Error("expected an owned claim"); + throw new Error( + `expected an owned claim; observed ${claim?.ownership ?? "missing"}` + ); } return { pid: claim.pid, birth: claim.birth }; }