Skip to content
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

fix: pipe workerIdleMemoryLimit to globalConfig #13106

Merged
merged 2 commits into from
Aug 9, 2022
Merged

Conversation

backmask
Copy link
Contributor

@backmask backmask commented Aug 8, 2022

Summary

New argument workerIdleMemoryLimit did not get forwarded from package.json to the workers. This fixes it. Context: #11956 (comment)

Test plan

Tested manually, added a console.log in TestRunner::createParallelTestRun, saw an undefined workerIdleMemoryLimit without the fix. Works with the fix

The following entry has to be added to package.json to test the fix

  "jest": {
    "workerIdleMemoryLimit": "500MB"
  },

@facebook-github-bot
Copy link
Contributor

Hi @backmask!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@SimenB
Copy link
Member

SimenB commented Aug 8, 2022

Ugh, almost same as #13105. Feels like we should have some tests it's properly threaded through 😅

@SimenB
Copy link
Member

SimenB commented Aug 8, 2022

@backmask this fixes both the issues you mentioned in the linked comment?

@backmask
Copy link
Contributor Author

backmask commented Aug 8, 2022

@backmask this fixes both the issues you mentioned in the linked comment?

This fixes the first issue (the flag having no effect). It does not fix workers being killed and not respawning. For the second bug, I haven't found a fix or if I have done a misconfiguration. I will let you know if I find anything!

@phawxby
Copy link
Contributor

phawxby commented Aug 8, 2022

@backmask this fixes both the issues you mentioned in the linked comment?

This fixes the first issue (the flag having no effect). It does not fix workers being killed and not respawning. For the second bug, I haven't found a fix or if I have done a misconfiguration. I will let you know if I find anything!

Back from vacation, investigating now

@phawxby
Copy link
Contributor

phawxby commented Aug 8, 2022

@backmask this fixes both the issues you mentioned in the linked comment?

This fixes the first issue (the flag having no effect). It does not fix workers being killed and not respawning. For the second bug, I haven't found a fix or if I have done a misconfiguration. I will let you know if I find anything!

Your analysis is mostly correct... The workers are being killed, they are respaning, the request to re-run the request is being sent then just nothing. The plot thickens.

{ limit: 200000000, childUsage: 238479704, restart: true, pid: 89632 }
{ preState: 'restarting', state: 'ok', prePid: 89632, postPid: 89655 }
RESENDING REQUEST [
  1,
  true,
  'worker',
  [
    {
      config: [Object],
      context: [Object],
      globalConfig: [Object],
      path: '/Users/paul/Documents/GitHub/brand-engine/src/common/helpers/express/__tests__/listenForStatusCode.test.ts'
    }
  ]
]

As for the config fix above, that works correctly and should be merged.

@phawxby
Copy link
Contributor

phawxby commented Aug 8, 2022

I currently have no idea why but this promise is not resolving in a worker that has been restarted.
https://github.com/facebook/jest/blob/main/packages/jest-runner/src/testWorker.ts#L95

@phawxby
Copy link
Contributor

phawxby commented Aug 8, 2022

I have a test case for the issue as part of a new e2e test.
#13107

I should've created one of these in the original PR and we wouldn't have had these issues.

Heading to bed now, tomorrow will be trying to figure out why it's misbehaving.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's land this in the meantime as it's a correct tweak 🙂

@SimenB SimenB merged commit 6886eeb into jestjs:main Aug 9, 2022
@github-actions
Copy link

github-actions bot commented Sep 9, 2022

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants