Open octogonz opened 3 years ago
I bet that this will be fixed by the improved subprocess management in PR https://github.com/microsoft/rushstack/pull/2717
PR #2717 did not fix the problem. :-/
Does Jest give us its subprocess PIDs? Wonder if we can just aggressively kill those.
Summary
When Heft is terminated using CTRL+C, Jest subprocesses sometimes linger and interfere with future operations.
Repro steps
Our users report that occasionally they will see an error like this:
Details
Possible fixes:
heft clean
more robust for this scenario.The
.heft/build-cache/jest-cache/
folder gets registered forheft clean
by this code:https://github.com/microsoft/rushstack/blob/78aa5aded8051d9f38e8cf0d1513f20707edc54a/apps/heft/src/plugins/JestPlugin/JestPlugin.ts#L143-L152
The race condition happens like this:
rushx build
, Heft's Jest plugin tries to delete the.heft/build-cache/jest-cache/ folder
usingFileSystem.deleteFolderAsync()
. For each subfolder, it first deletes all the contents, then tries to delete the subfolder itself.Note that the FileSystem.js callstack is truncated because some code is still using promises instead of
async
/await
. We should fix that if possible.Standard questions
Please answer these questions to help us investigate your issue more quickly:
@rushstack/heft
version?node -v
)?