From 23b1aac6a7606bf317d3f95f4e3923f9493047be Mon Sep 17 00:00:00 2001 From: rebuildup Date: Sun, 29 Nov 2026 21:33:38 +0900 Subject: [PATCH] test(e2e): retry UC-B09 collapse seed when teardown persist clobbers it The outgoing panel document can flush its in-memory chrome state during reload teardown and overwrite the seeded control-panel.json before the new document reads it (results-final-205730 UC-B09: re-seeded collapsed survived as expanded; isolated repro failed at toggle mount). Seed, reload, and verify the file converged to the seeded value; retry once on clobber. Also use the fresh panel handle after the second reload. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- scripts/verify/e2e/cases/workspace.ts | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/verify/e2e/cases/workspace.ts b/scripts/verify/e2e/cases/workspace.ts index c55a120d..3c3ecf47 100644 --- a/scripts/verify/e2e/cases/workspace.ts +++ b/scripts/verify/e2e/cases/workspace.ts @@ -1316,10 +1316,23 @@ export const workspaceCases: E2ECase[] = [ } return value; }; + // The outgoing document can flush its in-memory chrome state + // during teardown and clobber the seed before the new document + // reads it (same persist race as UC-E01 restore, #845). Verify + // the file still holds the seed after boot and retry once. + const seedCollapsedAndReload = async ( + collapsed: boolean, + ): Promise => { + for (let attempt = 0; ; attempt++) { + await seedCollapsed(collapsed); + const panel = await reloadPanel1(ctx, 45_000); + const settled = await waitFileCollapsed(collapsed); + if (settled === collapsed || attempt === 1) return panel; + } + }; await withManagedRootSnapshot(ctx, "uc-b09-cp-collapse", async () => { - await seedCollapsed(true); - const panel = await reloadPanel1(ctx, 45_000); + const panel = await seedCollapsedAndReload(true); const cpSeen = await waitForDom( ctx, @@ -1397,11 +1410,10 @@ export const workspaceCases: E2ECase[] = [ // Round-trip the other direction through persistence: re-seed // collapsed and confirm boot restores it (the collapse action // itself is a native context-menu path, not DOM-addressable). - await seedCollapsed(true); - await reloadPanel1(ctx, 45_000); + const reseeded = await seedCollapsedAndReload(true); const recollected = await waitForDom( ctx, - panel, + reseeded, `(() => { const cp = document.querySelector("[data-cp]"); return cp && cp.getAttribute("data-collapsed") === "true"; @@ -1412,7 +1424,7 @@ export const workspaceCases: E2ECase[] = [ check( "re-seeded collapsed state survives reload", Boolean(recollected), - await domCollapsed(panel), + await domCollapsed(reseeded), ), ); });