Repository navigation
fix(console): clear JWKS cache between setups in edge test (#16903) - #16926
Conversation
…he before second setup
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
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. |
Fixes #16903
Diagnosis
The
pm-console nightlyrun 46283201645 failed on main ata16a08ain thetest pm-consolejob. The failing test was:in
pm-stack/console/test/edge.test.ts./console/api/machinesreturned401 {"error":"the presented token was not accepted"}, leavingunstampedMachines.machines[0]undefined.Root cause
The test calls
setup()twice (sameandunstamped). Each call creates a fresh signing keypair, butjwksCacheinsrc/auth.tsis 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 secondsetup(), following the existing multi-setup test pattern.Verification
pm-edgestorage 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-botwith what you need.