ci(smoke): wait for the keychain strip before judging #105 step 2

Step 2 mirrors the tokens, reads them back, then strips them from
localStorage in the same boot. The check stopped at the first "mirrored"
sighting, so a step-2 build could be reported as "before step 2" (n/a).
Wait up to 30 s for tokensIn === keychain; only call it n/a if it is still
mirrored-only after that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
This commit is contained in:
Lotus CI
2026-10-26 02:32:26 -04:00
co-authored by Claude Opus 5.5
parent fb4cc84087
commit 76c08a3b76
+8 -3
View File
@@ -406,11 +406,16 @@ record(
try {
await page.evaluate(([k, f]) => localStorage.setItem(k, JSON.stringify(f)), [KEY, fake]);
await page.reload();
const moved = await until(async () => {
// Step 2 mirrors the tokens, reads them back to verify, and only then strips
// them from localStorage, all in the same boot. Wait for the strip rather
// than stopping at the first "mirrored" sighting (that in-between state made
// a step-2 build look like a step-1 one).
const stripped = await until(async () => {
const st = await state();
return st.tokensIn === 'keychain' || (st.blobHasToken && st.kcToken === fake.accessToken) ? st : undefined;
return st.tokensIn === 'keychain' ? st : undefined;
}, 30_000);
if (moved && moved.tokensIn !== 'keychain') {
const moved = stripped ?? (await state());
if (!stripped && moved.blobHasToken && moved.kcToken === fake.accessToken) {
record(name, 'n/a', 'build mirrors the tokens but keeps them in localStorage (before step 2)');
} else {
await page.reload();