Skip to content

Repo: Unit tests occasionally run out of memory in CI #7245

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

Closed
JoshuaKGoldberg opened this issue Jul 16, 2023 · 2 comments · Fixed by #7249
Closed

Repo: Unit tests occasionally run out of memory in CI #7245

JoshuaKGoldberg opened this issue Jul 16, 2023 · 2 comments · Fixed by #7249
Labels
accepting prs Go ahead, send a pull request that resolves this issue repo maintenance things to do with maintenance of the repo, and not with code/docs tests anything to do with testing

Comments

@JoshuaKGoldberg
Copy link
Member

Suggestion

Example: #7237 -> https://github.com/typescript-eslint/typescript-eslint/actions/runs/5570322069/jobs/10174312540?pr=7237

PASS  tests/rules/indent/indent.test.ts
 PASS  tests/rules/explicit-function-return-type.test.ts
<--- Last few GCs --->
[2311:0x63a[37](https://github.com/typescript-eslint/typescript-eslint/actions/runs/5570322069/jobs/10174312540?pr=7237#step:5:38)60]   100923 ms: Scavenge 2022.3 (2074.4) -> 2018.6 (2075.9) MB, 23.69 / 0.00 ms  (average mu = 0.467, current mu = 0.[38](https://github.com/typescript-eslint/typescript-eslint/actions/runs/5570322069/jobs/10174312540?pr=7237#step:5:39)9) allocation failure; 
[2311:0x63a3760]   101009 ms: Scavenge 2024.3 (2076.4) -> 2020.3 (2079.1) MB, 18.[40](https://github.com/typescript-eslint/typescript-eslint/actions/runs/5570322069/jobs/10174312540?pr=7237#step:5:41) / 0.00 ms  (average mu = 0.467, current mu = 0.389) allocation failure; 
[2311:0x63a3760]   101055 ms: Scavenge 2027.2 (2079.4) -> 2021.7 (2096.6) MB, 12.23 / 0.00 ms  (average mu = 0.467, current mu = 0.389) allocation failure; 
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0xc9[42](https://github.com/typescript-eslint/typescript-eslint/actions/runs/5570322069/jobs/10174312540?pr=7237#step:5:43)40 node::Abort() [/opt/hostedtoolcache/node/20.4.0/x64/bin/node]
 2: 0xb6df9f  [/opt/hostedtoolcache/node/20.4.0/x64/bin/node]

Sigh.

Maybe #7112 would help with this? Hard to know without trying it out repeatedly. But either way, anecdotally I've seen this happen in at least a couple of PRs this month.

@JoshuaKGoldberg JoshuaKGoldberg added tests anything to do with testing repo maintenance things to do with maintenance of the repo, and not with code/docs accepting prs Go ahead, send a pull request that resolves this issue labels Jul 16, 2023
@bradzacher
Copy link
Member

Maybe we just allocate more memory?
It's no skin off our nose how much resources we're using - as long as we don't overload the box!

@rubiesonthesky
Copy link
Contributor

This is probably because of this notorious issue from Jest jestjs/jest#11956 which is caused by bug in node. (They have tried to fix it but then had to revert it, can't find the issue from node repo right now)

  • You can try to set WorkerIdleMemoryLimit https://jestjs.io/docs/configuration#workeridlememorylimit-numberstring to 300-500 MB to see if that helps. That will make it so, that when worked exceeds that limit, new worker will be created for next test suite.
  • Using node --expose-gc --no-compilation-cache - This didn't help the code base that I'm most familiar with, because it's using Angular but could help here.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue repo maintenance things to do with maintenance of the repo, and not with code/docs tests anything to do with testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants