chore(test): de-sequentialize temp-dir tests via per-test TmpDir context - #9916
Merged
Conversation
…ests # Conflicts: # test/src/mac/pkgTargetUnitTest.ts
|
mmaietta
marked this pull request as ready for review
June 16, 2026 14:59
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.
Summary
Removes the test-suite's reliance on
{ sequential: true }for temp-directory isolation so those blocks run in parallel again.The suite runs
concurrent: trueby default. A recurring anti-pattern forced blocks back to serial:The per-test tmpDir plugin already gives every test its own
context.tmpDir. The only bug was storing the created path in a module-scopedlet tmpDirthat interleavedbeforeEachcalls overwrite —{ sequential: true }was a workaround for that race. Fix: create the temp dir inside each test from the per-test context, in a localconst:Design notes
s3PublishTest.tswas intentionally left unchanged. Its three blocks stay sequential (https.request mock +__TEST_S3_PUBLISHER__env), theirbeforeEachalready uses the per-testcontext.tmpDircorrectly, and the value tests read is a derivedtestFile/srcDirbuilt inbeforeEach— nottmpDirdirectly. A per-test conversion would inline file+mock setup into ~15 tests with no parallelism gain.A few
sequential: trueblocks remain untouched because they serialize for non-tmpDir reasons:archiveUtilTest.tscompute7zCompressArgs(vi.stubEnv) andwinSignToolManagerTest.tsPKCS#11 PIN via env var.Concurrency gotcha:
toMatchSnapshot()must use the test-contextexpect, not the globalexpectimport.blockmapTest.tsused the globalexpectand failed once de-sequentialized; fixed by destructuringexpectfrom each test context and dropping the global import.winReseditTest.ts(also snapshot-based) already used contextexpect.