Title: test-runner: fix potential memory leaks by abhishekSavani · Pull Request #60860 · nodejs/node · GitHub
Open Graph Title: test-runner: fix potential memory leaks by abhishekSavani · Pull Request #60860 · nodejs/node
X Title: test-runner: fix potential memory leaks by abhishekSavani · Pull Request #60860 · nodejs/node
Description: This pull request focuses on fixing resource leaks in the test runner, specifically targeting memory leaks caused by unclosed readline interfaces and unreleased event listeners in watch mode. It also introduces new tests to verify that these leaks are resolved and that resources are properly cleaned up across various test scenarios. Resource management improvements: Explicitly close the readline interface in runTestFile to prevent memory leaks after test execution. Refactor the file watcher in watchFiles to use a named event handler and add a cleanup function that removes the 'changed' event listener, ensuring listeners do not accumulate and are properly released. [1] [2] ✅ Prevent memory leaks in test runner process isolation mode ✅ Prevent listener accumulation in watch mode ✅ Improve long-running test suite stability ✅ Reduce memory consumption in CI/CD environments Why this matters: ISSUE 1 Without fix: readline.Interface stays open when child writes to stderr -> process might hang indefinitely With fix: rl.close() is called -> process exits cleanly Test catches regression: If someone removes rl.close(), test will timeout and fail ISSUE 2 Without fix: Anonymous listener can't be removed -> watch mode might not exit cleanly on SIGTERM With fix: Named function with cleanup -> proper shutdown Test catches regression: If cleanup is removed, watch mode won't exit on SIGTERM, test will timeout
Open Graph Description: This pull request focuses on fixing resource leaks in the test runner, specifically targeting memory leaks caused by unclosed readline interfaces and unreleased event listeners in watch mode. It al...
X Description: This pull request focuses on fixing resource leaks in the test runner, specifically targeting memory leaks caused by unclosed readline interfaces and unreleased event listeners in watch mode. It al...
Opengraph URL: https://github.com/nodejs/node/pull/60860
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:382f1683-1925-aa40-0f3d-fb8df8b02277 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | ACD4:104714:25B990:361883:6A4CCDFB |
| html-safe-nonce | f6fd687a3e0037d0cce78205de1ae0875c8cd206eea26cd87b767cf34fcfa236 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0Q0OjEwNDcxNDoyNUI5OTA6MzYxODgzOjZBNENDREZCIiwidmlzaXRvcl9pZCI6IjIxOTAyOTczNjk4NDg2MzA3NzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fb20b98f6497b8de993a18f47c39ca1d29a76c044f04e2cbfdd9fb1a49cd539e |
| hovercard-subject-tag | pull_request:3047221847 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/nodejs/node/pull/60860/files |
| twitter:image | https://avatars.githubusercontent.com/u/55618348?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/55618348?s=400&v=4 |
| og:image:alt | This pull request focuses on fixing resource leaks in the test runner, specifically targeting memory leaks caused by unclosed readline interfaces and unreleased event listeners in watch mode. It al... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | ee8a9d18044a05fe2d57b9ae797da38c8be34effb03f015f7c42e94770d28a1b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f84814acc6f036583fd43463f5847a846243d2a4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width