test(performance): validate the journey gate after the probe completes

Codex follow-up on #1698: the gate state returned by release() cannot see a
reload or recovery navigation that happens before the first card. Re-read the
live state once the renderer probe has finished and validate that instead,
so an iteration spanning an extra navigation is rejected.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Fable 5.1 committed 2026-09-26 17:22:13 +02:00
1 parent 5343e32c8f
commit 0de396197b
1 file changed
+12 -2
@@ -152,7 +152,7 @@ export async function measureLaunchJourney(
sentinelMethod: probeOptions.sentinelMethod,
stateKey: JOURNEY_MAIN_IPC_STATE_KEY,
});
const gate = await readJourneyRendererGate(
await readJourneyRendererGate(
electronApp,
JOURNEY_RENDERER_GATE_KEY,
'release'
@@ -172,7 +172,17 @@ export async function measureLaunchJourney(
probeOptions.stateKey,
timeoutMs
);
assertJourneyRendererGate(gate, renderer.installed.epochMs);
// Re-read after the probe finished: a reload or recovery
// navigation during startup shows up as a pass-through load
// only in the live state, and such an iteration is invalid.
const gate = assertJourneyRendererGate(
await readJourneyRendererGate(
electronApp,
JOURNEY_RENDERER_GATE_KEY,
'read'
),
renderer.installed.epochMs
);
const ipc = await readJourneyMainIpcCapture(
electronApp,
JOURNEY_MAIN_IPC_STATE_KEY,