Skip to content

🐛 fix: correct auth.test.tsx logout/setToken tests failing nightly unit shard 19 - #24656

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-24572
Oct 27, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-24572

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Refs #24572.

Root cause (nightly run 40458881935)

Go toolchain is fine now (GO_VERSION 1.26.10). unit-test failed for two reasons:

  1. Shard 19/48 — 2 deterministic failures in web/src/lib/auth.test.tsx (fail with retry x2), introduced by 🐛 fix: stop auth.test.tsx OOM recursion and unhandled rejections in nightly unit shards #24637, which made clearStoredAuthToken() also remove the legacy kc_token test key:

    • logout() sends POST to /auth/logout with bearer token: the test mocked /api/me with { ok: true } (no json()), so mount-time refreshUser() threw meResponse.json is not a function, dropped to login and cleared the token. logout() then had no token, so only 1 fetch (/api/me) occurred. Fix: mock a valid /api/me user, then the logout response.
    • setToken() triggers refreshUser(): setToken() never calls refreshUser() (AuthCallback.tsx calls it explicitly), so /api/me count stayed 0. Fix: test the real contract — setToken() + refreshUser(newToken) sends /api/me with the new bearer token and populates the user.
  2. Shards 26/48 and 34/48 timed out after 900s (Shard N TIMED OUT ... (hung test?)). Vitest output does not name the hung file; last completed files were analytics-dispatch-coverage.test.ts (shard 26) and useUpgradeStateMachine.test.tsx (shard 34). Not fixed here — remains open under Nightly regression: unit-test #24572; next step is identifying the hanging file (e.g. --reporter=hanging-process or per-file timing in those shards).

Test-only change; no production code touched.

— hive: agent=scanner backend=copilot model=claude-fable-5 copilot=1.0.88

…en clearing

The nightly unit-test suite (shard 19) failed deterministically in
src/lib/auth.test.tsx after #24637 made clearStoredAuthToken() also drop
the legacy 'kc_token' test key:

- logout() POST test mocked /api/me with { ok: true } and no json(), so the
  mount-time refreshUser() failed, dropped to login and cleared the token;
  logout() then had no bearer token and never called /auth/logout.
- setToken() test expected setToken() to fetch /api/me, but setToken()
  never calls refreshUser(); AuthCallback.tsx calls it explicitly.

Refs #24572

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 27, 2026
@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 clubanderson 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

@netlify

netlify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kubestellarconsole ready!

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

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @hivecommons-hive[bot] — 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 github-actions Bot added the ai-generated Pull request generated by AI label Oct 27, 2026
@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 27, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-kubestellar-console-4vkt | SHA: 39f1b59

— hive: agent=scanner backend=copilot model=claude-fable-5 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 27, 2026
@github-actions

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.

@hivecommons-hive hivecommons-hive Bot linked an issue Oct 27, 2026 that may be closed by this pull request
@hivecommons-hive
hivecommons-hive Bot merged commit d16281f into main Oct 27, 2026
51 of 52 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-24572 branch October 27, 2026 10:04
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#246562473952` sha256:7e6576f137ae503bdc76c0cd0a1bfa735403237942dcd848c73a7a1d4add9456 — download from the dashboard or `hivectl review evidence #24656`.

@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

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge build verification passed ✅

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

@github-actions

Copy link
Copy Markdown
Contributor

⏹️ Post-Merge Verification: cancelled

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

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 author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tier/1-lightweight

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nightly regression: unit-test

0 participants