test: clean up process exit listeners after each test#355
Open
Tony133 wants to merge 1 commit into
Open
Conversation
f90cb6e to
3657f65
Compare
3657f65 to
735bc1c
Compare
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.
Proposal:
test/command-publish.test.jsto properly manage and sanitize processexitlisteners.Changes:
beforeEachhook to store the state of activeprocess.listeners('exit')before each test execution.afterEachhook to purge any orphan process exit listeners registered byproxyquiresub-dependencies during the test run.Why is this needed?
proxyquirewere registering persistentexitlisteners on the main process without removing them. This could leak memory and pollute the Node.js process environment, potentially disrupting proper process signaling, child process management, or Inter-Process Communication (IPC) boundaries during test orchestration in strict CI pipelines. ( see error here: https://github.com/fastify/releasify/actions/runs/28734462005/job/85212333752#step:5:228)This PR should resolve this error CI ( in Nodejs v24.18.0 ):