Conversation
Integration files created private state roots, so a concurrent file could auto-allocate a public port that a stopped composition in another file had saved, and the restart then reported the port as occupied. The suite now matches the supported topology of one state root per host. - A vitest globalSetup creates one state root per run and provides it to every test that binds real listeners on automatic public ports; those tests use unique stack IDs. - Tests that only simulate allocation, bind no public ports, or assert the exact contents of a root keep private roots. - In-process owner doubles take the stack lease before registering, like the product owner, so another file's orphan sweep cannot reclaim them. - Whole-root discovery and snapshot assertions are scoped to the test's own stacks. - The shared root's Docker snapshot-cache volume is removed once by the suite teardown instead of per test. - Fixed test ports move below the automatic span. - A Ports regression covers a stopped sibling's saved port that is the competitor's first scan candidate. Concurrent integration runs from other checkouts on the same host use separate roots and remain outside the supported topology.
…integration-state-root # Conflicts: # packages/stack/tests/docker-fixture.ts # packages/stack/vitest.config.ts
…integration-state-root # Conflicts: # packages/stack/src/Ports.integration.test.ts
The native workload cleanup test used a fresh artifact cache, so every run downloaded psql inside the test body and timed out whenever the download was slow. It now uses the shared artifact cache and prepares psql in a beforeAll hook, so the test timeout covers only the cleanup retries it asserts.
Native backend ports now come from the same span as automatic public ports and skip only the claims they are given. Service tests that passed no claims, and an owner test that starts a native service on a private root, could take a stopped shared-root stack's saved port, which is the collision the shared root removes. - Service integration tests that can reserve native backend ports read the shared root's claims. - The Owner test that starts REST natively uses the shared root. - The native reservation, exclusion and loopback Ports tests avoid shared claimed ports and start their second scan at the port under test, so a released shared claim cannot satisfy their assertions. - The sibling regression keeps both stacks in the shared root and takes the colliding port from the actual allocation.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The stack integration suite gave almost every test its own temporary state root. Automatic public ports skip only ports saved by stacks under the same root, so a concurrently running file could take the port a stopped composition in another file had saved. The restart then failed with
Public port … is already in use, as seen intermittently inSupabase.native.integration.test.ts("promotes a stopped database composition without replacing its identity or data"). An occupied saved port reporting a conflict is the intended product behaviour; the suite was outside the supported topology of one state root per host.The suite now follows that topology:
globalSetupfor the integration project creates one state root per run and provides it viainject. Every test that binds real listeners on automatic public ports (including composition creation, which binds immediately) uses it with unique stack IDs.registerLeased, which takes the stack lease before saving, likerunStackHost. Without it, another file's orphan sweep could reclaim a stack whose in-process owner holds no lease.discoverand snapshot-descriptor assertions in migrated files check the test's own stacks.Ports.integration.test.tsavoid shared claimed ports while still targeting the port under test.makeDockerDatabaseRootcan place a Docker data root under the shared root. The shared root's Docker volume is removed by the existing per-run, label-based cleanup intests/docker-volume-run.ts.CommandRunner.native-cleanup.integration.test.tsdownloaded psql into a fresh cache inside its test body and timed out on slow downloads; it now uses the shared artifact cache and prepares psql in abeforeAllhook.Concurrent integration runs from other checkouts on the same host still use separate roots and remain outside the supported topology.