-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add workerIdleMemoryLimit to support worker recycling in the event of node >16.11.0 memory leaks #13056
Conversation
I'm going to try and write some more tests for this so even if approved don't merge yet |
@@ -478,6 +480,7 @@ export type ProjectConfig = { | |||
transformIgnorePatterns: Array<string>; | |||
watchPathIgnorePatterns: Array<string>; | |||
unmockedModulePathPatterns?: Array<string>; | |||
workerIdleMemoryLimit?: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be part of global config, not project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see the case for both. You may want to set a sensible global default perhaps running on a machine with known memory usage limitations but then configure specifically for projects where you may use less threads and allow more memory. In all honesty I could go either way, if you want it removing I can remove it.
exciting! thanks for looking into it! |
@SimenB this should be better now. I've created edge case tests using actual workers (as opposed to mocked ones) to validate that they behave as expected. |
Are some of these tests expected to be failing? |
There is some flake, but the failures now seems to be the new tests? |
Some of them seem to be a dependency bug. chalk/supports-color#135 |
Actually I think I'm being dumb |
@SimenB do you have any good ideas why those 2 tests seem to be failing in CI? They work absolutely fine locally with the same commands. |
@SimenB done. I think I may have solved my flaky test problem too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! this looks good to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
@SimenB what's the release process/cycle for Jest? |
Stable release next week |
Was trying this out this morning and ran into a config validation issue:
The Seems to me like |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
@phawxby the "edge cases" test seems to consistently fail on CI for Node 21 🤔 You wouldn't be chance have any ideas about that, would you? https://github.com/jestjs/jest/actions/runs/8109877723/job/22166077828
|
Sorry @SimenB I've not even looked at the changelog for Node 21 so no ideas off the top off my head. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
#11956 (comment)
Test plan
Numerous new test cases added except it's hard to test for the specific issue as the memory usage problem is extremely hard to replicate outside of very complicated applications
Ideally I would like to end-end test this but I have no idea how I would do that