Open
Conversation
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Resolved the JavaScript heap out-of-memory issue occurring during Vitest execution in CI for PR #4114. The root cause was identified as the AutoUpdate component creating intervals (setInterval) during test execution without proper cleanup, leading to memory leaks and eventual heap exhaustion.
Mocked the AutoUpdate component in the test environment to prevent interval creation. Additional improvements were made to stabilize test execution, including enabling fake timers and adjusting the test timeout. This ensures reliable linting and coverage enforcement as part of the Code Coverage Improvement Initiative.
Fixes # (bug list priority high) Vitest Memory Exhaustion in PR #4114
Implements # Code Coverage Improvement Initiative
Related PRS (if any):
This frontend PR is related to #4114 (linting and Vitest coverage enforcement).
No backend dependency required.
…
Main changes explained:
Mocked the AutoUpdate component in setupTests.js to prevent interval execution during tests
Updated vitest.config.js to enable fake timers for better control of async operations
Increased test timeout to avoid premature failures in CI
Updated CI workflow to include higher memory allocation for test execution
Ensured all tests, linting, and coverage scripts run successfully without memory issues
…
How to test:
Check out the current branch
Run npm install
run npm test
run npm run test: coverage
run npm run lint
Verify all tests pass without timeout or memory errors
optionally run CI=true npm run test: coverage to simulate CI behavior
push changes and verify GitHub Actions passes for PR #4114
Screenshots or videos of changes:
All test files passing locally (306 passed, 1 skipped)
Coverage run completed successfully without heap errors
Note:
Root cause was not related to threads, forks, or memory limits but due to uncontrolled intervals in tests
Mocking AutoUpdate eliminates memory leaks and stabilizes Vitest execution
Increasing memory and timeout are supporting improvements, not primary fixes
Future similar issues can be avoided by mocking components with timers or heavy async behavior