Skip to content

Clear Fantom's Metro shutdown timer once the server closes - #59710

Open
lazerg wants to merge 1 commit into
react:mainfrom
lazerg:fix/issue-59699-teardown-timer
Open

lazerg wants to merge 1 commit into
react:mainfrom
lazerg:fix/issue-59699-teardown-timer

Conversation

@lazerg

@lazerg lazerg commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Summary:

stopMetroServer in Fantom's global teardown races the Metro server's close against a 5 second setTimeout, but never clears that timer when close wins. The pending timer keeps Node's event loop alive, so every yarn fantom run hangs for about 5 seconds after the summary and Jest prints "Jest did not exit one second after the test run has completed". This clears the timer once the race settles.

Fixes #59699

Changelog:

[INTERNAL] [FIXED] - Clear Fantom's Metro shutdown timer once the server closes

Test Plan:

Ran the same close-vs-timeout race against a plain Node http server: without clearTimeout the process exits about 5 s after teardown returns, with it the process exits right away. yarn flow check, eslint and prettier pass on the file. I don't have Fantom's tester built locally, so I didn't run yarn fantom itself.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 31, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 31, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

1 participant