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:
iamtoruk 2026-09-02 23:18:21 -07:00
parent 7e0d1eca6e
commit 25a778cef2

View file

@ -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
}