Repository navigation
[heft-jest-plugin] Supervise sequential Jest worker lifecycles - #6207
Open
Yashwanth Reddy Verupaka (yashwanth195) wants to merge 3 commits into
Open
Yashwanth Reddy Verupaka (yashwanth195) wants to merge 3 commits into
Yashwanth Reddy Verupaka (yashwanth195) wants to merge 3 commits into
Conversation
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.
Summary
Jest can restart a worker between tasks when its idle-memory limit is exceeded. Sending the next task before the replacement is ready can turn an expected recycle into a task failure. Unexpected worker exits must also be reported rather than silently retrying in-flight work.
This PR adds
JestManagedWorkerQueueto supervise a single sequential worker configured with zero retries. It observes Jest's public task callbacks and lifecycle events, lets the caller wait for replacement readiness before dispatching another task, and retains unexpected exit or replacement failures while stopping the owned workers. It also recognizes expected recycling after the final task so the caller can handle shutdown without waiting for a replacement that has no work to perform.This is a standalone foundation for future managed-runner integration. It does not enable managed sharding or change ordinary Jest execution.
Details
jest-worker ~30.3.0and update both subspaces' dependency metadata, including the injected snapshot and generated hashes required by CI.How it was tested
On Windows with Node 24.22.1 and Rush 5.182.0:
node common\scripts\install-run-rush.js test --only @rushstack/heft-jest-plugin --parallelism 4— passed build/lint and all 38 tests, including 16 real process/thread lifecycle cases.node common\scripts\install-run-rush.js install --subspace build-tests-subspace— passed frozen installation after refreshing injected dependency metadata.Coverage includes worker reuse/recycling, replacement readiness, unexpected exits without replay, final-task shutdown, and failure cleanup. Full managed-runner integration is deferred.
Impacted documentation
Updated the package README and class-level caller contract. No website or schema changes.