Skip to content

Commit bac74f1

Browse files
committed
test(e2e): drop viewStates diagnostics, give the poll a 30s budget
The 15s viewStates poll timed out once at 30c4f0c while 85 other e2e tests passed; the same code with diagnostics (16c6c64) ran green, confirming a timing flake rather than a regression. The DIAG logs showed the serialized write queue produced the correct ask/debug entries. Remove the temporary write/clear/rekey and read logging from ClineProvider (back to the 30c4f0c content) and the test, and raise the poll budget from 15s to 30s to match the suite's other waits (waitUntilCompleted, follow-up polling) so a slow memento flush under CI load cannot turn a correct write into a failure.
1 parent 16c6c64 commit bac74f1

2 files changed

Lines changed: 6 additions & 36 deletions

File tree

‎apps/vscode-e2e/src/suite/view-state.test.ts‎

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,9 @@ suite("Roo Code View State", function () {
9292
// Both per-view writes are awaited through the serialized view-state write queue
9393
// before the tasks complete, but a just-resolved globalState write can momentarily
9494
// lag a synchronous globalState.get in the extension host. Poll until both
95-
// persisted selections are visible before asserting on them.
96-
// TEMP-DIAG: e2e viewStates visibility debugging; remove before merge.
97-
const diagSnapshot = () => {
98-
try {
99-
return (
100-
JSON.stringify(globalThis.api.getGlobalState("viewStates"))?.slice(0, 800) ??
101-
String(globalThis.api.getGlobalState("viewStates"))
102-
)
103-
} catch (error) {
104-
return `snapshot error: ${String(error)}`
105-
}
106-
}
107-
console.log(`[DIAG-VS-READ-START] viewStates=${diagSnapshot()}`)
95+
// persisted selections are visible before asserting on them. The 30s budget
96+
// matches the suite's other waits (waitUntilCompleted, follow-up polling) so a
97+
// slow memento flush under CI load cannot turn a correct write into a flake.
10898
await waitFor(
10999
() => {
110100
const persisted = globalThis.api.getGlobalState("viewStates") as GlobalState["viewStates"]
@@ -120,11 +110,8 @@ suite("Roo Code View State", function () {
120110
entries.some(([, entry]) => entry.mode === "debug")
121111
)
122112
},
123-
{ timeout: 15_000 },
124-
).catch((error) => {
125-
console.log(`[DIAG-VS-READ-TIMEOUT] viewStates=${diagSnapshot()}`)
126-
throw error
127-
})
113+
{ timeout: 30_000 },
114+
)
128115

129116
const viewStates = globalThis.api.getGlobalState("viewStates") as GlobalState["viewStates"]
130117
assert.ok(viewStates, "Expected persisted viewStates to exist")

‎src/core/webview/ClineProvider.ts‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -598,14 +598,7 @@ export class ClineProvider
598598
states[viewStateId] = next
599599
}
600600

601-
const pruned = this.prunePersistedViewStates(states)
602-
// TEMP-DIAG: e2e viewStates visibility debugging; remove before merge.
603-
this.log(
604-
`[DIAG-VS-WRITE] viewStateId=${viewStateId} values=${JSON.stringify(values)} map=${
605-
JSON.stringify(pruned)?.slice(0, 500) ?? String(pruned)
606-
}`,
607-
)
608-
await this.contextProxy.setValue("viewStates", pruned)
601+
await this.contextProxy.setValue("viewStates", this.prunePersistedViewStates(states))
609602
})
610603

611604
ClineProvider.persistedViewStateWriteQueue = write.catch(() => {})
@@ -620,10 +613,6 @@ export class ClineProvider
620613
const write = ClineProvider.persistedViewStateWriteQueue.then(async () => {
621614
const states = this.getPersistedViewStates({ fresh: true })
622615
delete states[viewStateId]
623-
// TEMP-DIAG: e2e viewStates visibility debugging; remove before merge.
624-
this.log(
625-
`[DIAG-VS-CLEAR] viewStateId=${viewStateId} map=${JSON.stringify(states)?.slice(0, 500) ?? String(states)}`,
626-
)
627616
await this.contextProxy.setValue("viewStates", states)
628617
})
629618

@@ -707,12 +696,6 @@ export class ClineProvider
707696
states[nextViewStateId] = previous
708697
}
709698

710-
// TEMP-DIAG: e2e viewStates visibility debugging; remove before merge.
711-
this.log(
712-
`[DIAG-VS-REKEY] from=${previousViewStateId} to=${nextViewStateId} map=${
713-
JSON.stringify(this.prunePersistedViewStates(states))?.slice(0, 500) ?? ""
714-
}`,
715-
)
716699
await this.contextProxy.setValue("viewStates", this.prunePersistedViewStates(states))
717700
})
718701

0 commit comments

Comments
 (0)