Skip to content

fix(console): clear JWKS cache between setups in edge test (#16903) - #16926

Merged
developing-today-fleet[bot] merged 1 commit into
mainfrom
fix/16903-console-edge-jwk-cache-shim
Nov 29, 2026
Merged

developing-today-fleet[bot] merged 1 commit into
mainfrom
fix/16903-console-edge-jwk-cache-shim

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #16903

Diagnosis

The pm-console nightly run 46283201645 failed on main at a16a08a in the test pm-console job. The failing test was:

before the host's first report > machines: a machine on the Worker's own tree, or a Worker that does not know its tree, is never said to diverge

in pm-stack/console/test/edge.test.ts. /console/api/machines returned 401 {"error":"the presented token was not accepted"}, leaving unstampedMachines.machines[0] undefined.

Root cause

The test calls setup() twice (same and unstamped). Each call creates a fresh signing keypair, but jwksCache in src/auth.ts is module-global and keyed by issuer URI with a 10-minute TTL. The second setup's edge reused the first setup's cached JWKS, so its owner token failed signature verification. This is a test-isolation defect; production has one issuer/key set. Other multi-setup tests already clear the cache between setups.

Fix

Call clearJwksCache() before the second setup(), following the existing multi-setup test pattern.

Verification

  • Red→green: the named regression test failed without the cache clear and passed with it, on the affected test setup.
  • Targeted test after the fix: 1 pass, 0 failures.
  • Full suite with the fix: 878 pass, 14 fail, 11 errors. Clean-main baseline: 877 pass, 15 fail, 11 errors. The unrelated baseline failures include release tests timing out and pm-edge storage errors; this change reduces the count by the targeted failure and adds no failures.

Lane: oc-code-03 (worker repo-worker-code), Fleet task 26450.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c2773d21-eae2-4144-b2ed-4bb8d62f51f0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Merged by landings lane 1207-C (charlie ADVANCE 2026-11-29) under Drew's merge-when-verified rule (CI not a gate). Verified firsthand: full diff read = exactly +1/-0 in pm-stack/console/test/edge.test.ts — clearJwksCache() before the second setup(), matching the body's root-cause (module-global jwksCache keyed by issuer only) and the existing multi-setup pattern in the same file; body verification (red→green at a16a08a, no new failures vs clean-main baseline) read and consistent with the diff. Fresh pre-merge: OPEN, non-draft, CLEAN/MERGEABLE at unchanged head f1e638b on two agreeing gh reads (pr view + REST). No author merge-gate stated on this PR. Fixes #16903.

@developing-today-fleet
developing-today-fleet Bot merged commit 50c09a1 into main Nov 29, 2026
2 checks passed
@developing-today-fleet
developing-today-fleet Bot deleted the fix/16903-console-edge-jwk-cache-shim branch November 29, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

main-broken: developing-today/code pm-console nightly @a16a08a — test pm-console

0 participants