Host E2E undo tests fail (executeCommand undo non-functional in .vscode-test) — blocks #40 + makes main E2E red #54
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The host E2E tests that drive
vscode.commands.executeCommand("undo")—undoMarks.test.ts(#38) ands40Provenance.test.ts(#40) — fail intermittently,and are currently failing deterministically in the local
.vscode-testharness: the
undocommand does not restore the text, so the assertions(
undo restored …) fail before any product behavior is checked. This makesmain's E2E red in the affected environment and blocks verifying #40.Diagnostic (session 0048 — conclusive)
An isolated probe (open doc →
showTextDocument, assertedactiveTextEditor === doc→ delete via the active editor'seditor.edit()→executeCommand("undo"))left the deletion standing (
"alpha charlie", bravo not restored). So it is:.vscode-test/user-dataaside to force a freshone did not help.
workspace.applyEditandeditor.editfail.The unchanged #38 test fails identically on clean
main, so it is not aproduct regression — it is the
undocommand itself being non-functional in thisheadless test instance (likely a VS Code-version / test-runner behavior).
Impact
mainE2E is red in any environment where this reproduces.undo works in E2E —
s40-undo-provenanceis implemented + unit-green but parked.Likely fixes (to investigate)
@vscode/test-electron(runTest.ts).instance.
preflight undo-capability probe (skip-with-loud-warning when unavailable) so the
suite isn't falsely red — but only as a backstop, never silently.
Source
Surfaced repeatedly (flake first noted session 0037); made deterministic and fully
diagnosed in session 0048 while implementing #40.
Resilience fix shipped (#55, merged to main): a runtime preflight probe (
undoCapable.ts) gates the #38 undo suite viasuiteSetup— runs whereundoworks, skips with a loud warning (showspending) where it doesn't.mainE2E is no longer false-red in broken-undo environments. Verified locally: #38 suite skips (1 pending), both E2E passes exit 0.Keeping this open for the underlying need: make
undoactually work in the harness (or confirm it's an irreducible headless limitation) so #40's undo behavior gets real CI coverage. Whens40-undo-provenancelands, apply the samesuiteSetupguard to its suite. Also noticed:pretest:e2eshould cleanout/(stale compiled*.test.jsfrom other branches get run by the glob).