GD-436 follow-up: opt-in pipe-name suffix (GDUNIT4_PIPE_SUFFIX) for same-assembly parallel checkouts - #459
Open
jmund15 wants to merge 1 commit into
Open
GD-436 follow-up: opt-in pipe-name suffix (GDUNIT4_PIPE_SUFFIX) for same-assembly parallel checkouts#459jmund15 wants to merge 1 commit into
jmund15 wants to merge 1 commit into
Conversation
…UFFIX ## Why GD-436 / godot-gdunit-labs#441 scoped the testhost <-> Godot named pipe by assembly (`gdunit4-{assemblyId}`), which fixes collisions between *different* assemblies running in parallel. It does not cover concurrent runs of the *same* assembly: two checkouts or git worktrees of one project produce an identical `assemblyId`, so both runs derive the same pipe name and collide exactly as before the fix. ## What - `GodotRuntimeTestRunner` derives the pipe name through a new `BuildPipeName(assemblyId)` helper, used for both the `GodotRuntimeExecutor` pipe client and the `--pipe-name` argument handed to the spawned Godot process, so both endpoints stay in sync from the single derivation site. - When the `GDUNIT4_PIPE_SUFFIX` environment variable is set and non-empty, its value is sanitized (`[A-Za-z0-9_-]` only, capped at 16 characters) and appended: `gdunit4-{assemblyId}-{suffix}`. - Unset, empty, or fully-sanitized-away values yield exactly the current name, so default behavior is unchanged.
MikeSchulze
requested changes
Jul 25, 2026
MikeSchulze
left a comment
Collaborator
There was a problem hiding this comment.
I'd say that's one step too complicated. The pipe name is simply a key and should be unique. Therefore, we should use a UUID as a suffix instead; an additional environment variable is not necessary.
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.
Problem
#441 (shipped in 5.1.0-rc4) scoped the runtime pipe name to the test assembly's file name, fixing #436's multi-assembly collision. A gap remains: two checkouts of the same project (e.g. git worktrees used for parallel development, or two CI jobs on one runner) build identically-named assemblies, derive the identical pipe name, and still collide - the 10s
ConnectAsynctimes out and the run silently skips or aborts.Change
Opt-in, zero behavior change by default: if the environment variable
GDUNIT4_PIPE_SUFFIXis set and non-empty, it is sanitized ([A-Za-z0-9_-], capped at 16 chars) and appended to the pipe name:gdunit4-{assemblyId}-{suffix}. Unset/empty reproduces current behavior exactly. Both endpoints already receive the final name through the single derivation site (--pipe-namepass-through), so the change is one shared helper inGodotRuntimeTestRunner(the name was previously constructed twice in the ctor - once for the client, once for the server arg - so the helper also removes that duplication hazard).A caller isolating parallel checkouts sets the variable to a checkout-specific value (e.g. a short hash of the checkout path) before
dotnet test.Testing
Happy to rework this as a
.runsettingsoption (in the spirit ofRuntimeConnectTimeout) if you would prefer that surface - the env var was chosen so the value can vary per checkout without editing a tracked settings file.