[scanner] fix: resolve nightly unit-test OOM regression#20425
[scanner] fix: resolve nightly unit-test OOM regression#20425clubanderson wants to merge 2 commits into
Conversation
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
🐝 Hi @clubanderson! I'm Trusted users — org members and contributors with write access — can mention Automation may take a moment to start, and follow-up happens through workflow activity rather than chat replies. |
|
👋 Hey @clubanderson — thanks for opening this PR!
This is an automated message. |
a12aadd to
54e4207
Compare
✅ Test Coverage CheckAll new source files in this PR have corresponding test files. Checked |
♿ Accessibility Audit (WCAG 2.1 AA)✅ No WCAG 2.1 AA violations detected in audited routes. Powered by axe-core. Target: WCAG 2.1 AA compliance. |
There was a problem hiding this comment.
Pull request overview
This PR targets the nightly Vitest unit-test OOM regression by reducing CI memory overhead from Vitest process isolation, while adding additional cleanup and a couple of test/mock adjustments.
Changes:
- Disable Vitest
isolatein CI to avoid spawning a new subprocess per test file (mitigates CI OOM). - Add
vi.unstubAllGlobals()cleanup to reduce cross-test contamination when running without isolation. - Adjust a React test icon mock to avoid prop-spreading issues; switch a dev-only warning from
logger.warntoconsole.warn.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| web/vite.config.ts | Disables Vitest isolation in CI to reduce subprocess/memory overhead and prevent OOM. |
| web/src/test/setup.ts | Adds per-test vi.unstubAllGlobals() cleanup and updates comments around teardown behavior. |
| web/src/lib/modals/ModalRuntime.tsx | Adds a targeted eslint disable for react-refresh/only-export-components on a non-component export. |
| web/src/hooks/useMissions.provider.tsx | Switches a DEV-only fallback warning to console.warn. |
| web/src/components/dashboard/customizer/sections/tests/TemplateGallerySection.test.tsx | Simplifies mocked icon components to avoid problematic prop spreading in React dev mode. |
| vi.unstubAllEnvs() | ||
| vi.unstubAllGlobals() // Clear global stubs to prevent cross-test contamination when isolate:false (#20007) | ||
| vi.clearAllMocks() |
❌ Playwright Tests Failed📊 View Full ReportDownload the To view the report locally: # Download and extract playwright-report.zip
npx playwright show-report path/to/playwright-report |
Switch to pool: 'threads' in CI instead of disabling isolate. Threads share memory (no fork overhead), preventing OOM while preserving test isolation required by build-gate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: sec-check <sec-check@hive.kubestellar.io>
54e4207 to
f8c72a9
Compare
Fixes #20007
Problem
Nightly unit-test suite OOMs because
isolate: truespawns a subprocess per test file (2100+ files × 1 worker = OOM on 7GB CI runners).Solution
isolate: !process.env.CI— CI shares one process, local dev keeps isolationvi.unstubAllGlobals()in afterEach to prevent cross-test contamination without isolation