Repository navigation
test: isolate workflow integration persistence under a per-process data home - #41
Merged
osovv merged 1 commit intoNov 4, 2026
Conversation
Concurrent bun test processes collided on the shared ambient $XDG_DATA_HOME/vvoc/workflow/<sessionId>/ root: the suite's fixed session IDs and its cleanup hooks deleted another process's state mid-run (LAUNCH_PERSISTENCE_FAILED / ENOENT workflow-state.json.tmp-*). The file now redirects XDG_DATA_HOME to a pid-suffixed temp root in a file-scoped beforeAll and restores the caller's value in afterAll, and the workflow persistence block targets that same root instead of the shared import.meta.dirname path it previously materialized inside the source tree. No production persistence behavior changed.
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.
Why the change
Concurrent
bun testprocesses collide on the shared ambient$XDG_DATA_HOME/vvoc/workflow/<sessionId>/persistence root — the suite's fixed session IDs plus its before/after hooks that delete those directories make parallel runs fail withLAUNCH_PERSISTENCE_FAILED/ENOENT workflow-state.json.tmp-*.Special things to note
$XDG_DATA_HOME/vvoc/workflow/<sessionId>/workflow-state.jsoncontract; only the test file redirects the environment for its own process and restores the caller's value afterwards.workflow persistenceblock previously pointedXDG_DATA_HOMEatimport.meta.dirname, materializing state inside the source tree (src/plugins/vvoc/workflow/…) on one path shared by all processes; it now targets the same per-process temp root.afterAllremoves the temp root and restores the caller'sXDG_DATA_HOME, so other test files in the samebun testprocess are unaffected.Change outline
The whole suite now resolves persistence paths from one pid-suffixed root, set up once per file:
Every disk-touching block already resolves session directories from the environment at call time, so the redirect covers them all; the persistence block's own override switches from the shared source-tree path to the same per-process root. Two processes therefore never share a
<sessionId>directory, and mid-run hook deletions can no longer hit another process's state.