Skip to content

[scanner] fix: resolve nightly unit-test OOM regression#20425

Open
clubanderson wants to merge 2 commits into
mainfrom
scanner/fix-20007
Open

[scanner] fix: resolve nightly unit-test OOM regression#20425
clubanderson wants to merge 2 commits into
mainfrom
scanner/fix-20007

Conversation

@clubanderson

Copy link
Copy Markdown
Collaborator

Fixes #20007

Problem

Nightly unit-test suite OOMs because isolate: true spawns a subprocess per test file (2100+ files × 1 worker = OOM on 7GB CI runners).

Solution

  • Set isolate: !process.env.CI — CI shares one process, local dev keeps isolation
  • Add vi.unstubAllGlobals() in afterEach to prevent cross-test contamination without isolation
  • Fix mock prop-spreading issues causing TypeError in React dev mode
  • Replace logger.warn with console.warn in useMissions fallback

Copilot AI review requested due to automatic review settings July 6, 2026 17:35
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Jul 6, 2026
@netlify

netlify Bot commented Jul 6, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit c5956df
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a4c10e76dbf19000854be6e
😎 Deploy Preview https://deploy-preview-20425.console-deploy-preview.kubestellar.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign eeshaansa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🐝 Hi @clubanderson! I'm kubestellar-hive[bot], an automation bot for this repo.

Trusted users — org members and contributors with write access — can mention @kubestellar-hive in a comment to trigger repo automation.
On issues, that mention queues an automated fix attempt. On pull requests, it records extra context for existing automation.
This is not an interactive Q&A bot, so mentions should be treated as requests for automation rather than a conversation.

Automation may take a moment to start, and follow-up happens through workflow activity rather than chat replies.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

👋 Hey @clubanderson — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@kubestellar-hive kubestellar-hive Bot force-pushed the scanner/fix-20007 branch from a12aadd to 54e4207 Compare July 6, 2026 17:36
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 6, 2026
@github-actions github-actions Bot added the ai-generated Pull request generated by AI label Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

✅ Test Coverage Check

All new source files in this PR have corresponding test files.

Checked web/src/hooks/ and web/src/components/ against origin/main.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

♿ 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 isolate in 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.warn to console.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.

Comment thread web/src/test/setup.ts
Comment on lines 228 to 230
vi.unstubAllEnvs()
vi.unstubAllGlobals() // Clear global stubs to prevent cross-test contamination when isolate:false (#20007)
vi.clearAllMocks()
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

❌ Playwright Tests Failed

📊 View Full Report

Download the playwright-report artifact from the workflow run for screenshots and detailed traces.

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>
@kubestellar-hive kubestellar-hive Bot force-pushed the scanner/fix-20007 branch from 54e4207 to f8c72a9 Compare July 6, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull request generated by AI dco-signoff: yes Indicates the PR's author has signed the DCO. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tier/2-standard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nightly regression: unit-test

2 participants