mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-10-21 05:23:19 +00:00
test(menubar): ignore idleSeconds in the payload parity check
The parity test builds the payload twice over the same warm cache and expects the two to match. Since liveSessions landed, each session carries idleSeconds, whole seconds since its last activity, so two builds that straddle a second boundary differ by one and the test fails at random. Seen on the macOS runner. stableShape now zeroes it the way it already blanks the generated stamp.
This commit is contained in:
parent
7e0d1eca6e
commit
25a778cef2
1 changed files with 4 additions and 2 deletions
|
|
@ -68,10 +68,12 @@ async function seedFixture(): Promise<void> {
|
|||
process.env['CODEBURN_CACHE_DIR'] = cacheDir
|
||||
}
|
||||
|
||||
/** Everything but the per-call wall-clock `generated` stamp. */
|
||||
/** Everything but the wall-clock fields: the `generated` stamp and each live session's
|
||||
* `idleSeconds`, which ticks between two builds that straddle a second boundary. */
|
||||
function stableShape(payload: unknown): unknown {
|
||||
const clone = structuredClone(payload) as { generated?: string }
|
||||
const clone = structuredClone(payload) as { generated?: string; liveSessions?: { sessions: { idleSeconds: number }[] } }
|
||||
clone.generated = ''
|
||||
for (const session of clone.liveSessions?.sessions ?? []) session.idleSeconds = 0
|
||||
return clone
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue