Skip to content

[scanner] fix: resolve systemic test failures from #21283 regression#21296

Merged
clubanderson merged 1 commit into
mainfrom
scanner/fix-21284
Jul 19, 2026
Merged

[scanner] fix: resolve systemic test failures from #21283 regression#21296
clubanderson merged 1 commit into
mainfrom
scanner/fix-21284

Conversation

@clubanderson

Copy link
Copy Markdown
Collaborator

Fixes #21284

Root Cause

PR #21283 (commit 294a689) set isolate: process.env.CI ? false : true in web/vite.config.ts to work around suspected OOM crashes from chunk-splitting (#21083). With isolate: false, all test files in a CI shard share one Vitest worker process. The vi.stubGlobal() calls made at module scope in individual test files leaked into every subsequent file — because afterAll in setup.ts (which calls vi.unstubAllGlobals()) ran only once at the end of the shard, not once per file. This cross-file contamination caused 1598 test failures in Coverage Suite run #4339.

Fix

The isolate: true restoration was applied in commit 0f81cb019 (PR #21290). This PR completes the fix by updating web/src/test/setup.ts to:

  1. Replace the outdated comment on the afterAll block (which described the broken isolate: false behaviour) with accurate documentation of the current isolate: true semantics.
  2. Add an explicit DO NOT set isolate:false warning that references this issue to prevent recurrence.

Why isolate: false broke 1598 tests

isolate:true (correct) isolate:false (broken by #21283)
Each test file runs in its own subprocess All files in a shard share one worker
setup.ts re-imported per file → afterAll runs per file setup.ts loaded once → afterAll runs once at end of shard
Module-scope vi.stubGlobal() cleaned up after each file Stubs accumulate across all files; later files see contaminated globals

Update the afterAll comment in setup.ts to accurately describe the current
isolate:true behaviour (afterAll runs once per FILE, correctly cleaning up
vi.stubGlobal() stubs) and to warn that setting isolate:false causes
afterAll to run only once per shard — the root cause of 1598 test failures
in Coverage Suite run #4339.

Root-cause summary for #21284:
  PR #21283 set isolate:process.env.CI?false:true to work around suspected
  OOM crashes from chunk-splitting (#21083).  With isolate:false all test
  files in a shard share one Vitest worker process.  vi.stubGlobal() calls
  made at module scope in one file leaked into every subsequent file; the
  afterAll vi.unstubAllGlobals() in setup.ts ran only once at the end of
  the shard, not once per file, so contamination accumulated.
  Restoring isolate:true (PR #21290, commit 0f81cb0) fixed the failures.
  This commit updates setup.ts to make that constraint explicit and to
  point future maintainers at the full explanation in vite.config.ts.

Fixes #21284

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Scanner <scanner@kubestellar.io>
Copilot AI review requested due to automatic review settings July 19, 2026 21:08
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Jul 19, 2026
@netlify

netlify Bot commented Jul 19, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit c7bd31b
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a5d3ccd50a8e80008a6d6f5
😎 Deploy Preview https://deploy-preview-21296.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 mikespreitzer 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

@github-actions github-actions Bot added the ai-generated Pull request generated by AI label Jul 19, 2026
@github-actions

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.

@github-actions

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.

@kubestellar-prow kubestellar-prow Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 19, 2026
@clubanderson
clubanderson merged commit fb50d31 into main Jul 19, 2026
34 of 38 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-21284 branch July 19, 2026 21:09
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

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

Updates the Vitest global-stub cleanup documentation in web/src/test/setup.ts to reflect the restored isolate: true behavior in CI and to warn against reintroducing isolate:false, which previously caused widespread cross-file vi.stubGlobal() leakage and mass test failures.

Changes:

  • Rewrites the afterAll comment in setup.ts to describe current per-file isolation semantics.
  • Adds an explicit warning not to disable isolate again, referencing the prior failure incident.

Comment thread web/src/test/setup.ts
Comment on lines +242 to +244
// Clear global stubs when this test file finishes.
// With isolate:true (current setting in vite.config.ts), the setupFile runs inside
// each test file's own subprocess, so this afterAll executes once per FILE —
@github-actions

Copy link
Copy Markdown
Contributor

✅ Post-Merge Verification: passed

Commit: fb50d31b70610b262e4bcb045a08668fa83fd1f5
Specs run: smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/29703839551

@github-actions

Copy link
Copy Markdown
Contributor

Post-merge build verification passed

Both Go and frontend builds compiled successfully against merge commit fb50d31b70610b262e4bcb045a08668fa83fd1f5.

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.

🐛 1598 test failure(s) in Coverage Suite run #4339

2 participants