fix(vscode): retry temp directory cleanup in the e2e fixture - #6094
Open
tripleaceme wants to merge 7 commits into
Open
tripleaceme wants to merge 7 commits into
tripleaceme wants to merge 7 commits into
Conversation
The render e2e tests asserted on the rendered model's tab title with a bare
text selector. Recent VS Code builds show the active editor's name in the
chat view as well, so the selector matches two elements and Playwright fails
with a strict mode violation:
locator('text=sushi.customers (rendered)') resolved to 2 elements:
1) <a class="label-name">sushi.customers (rendered)</a>
2) <span class="monaco-highlighted-label">sushi.customers (rendered)</span>
aka getByLabel('Enable current file context').locator('a')
Match the editor tab by role instead, which ignores the chat entry. Verified
against code-server 4.107.1 and 4.137.0.
Signed-off-by: Adegbite Ayoade <tripleaceme@gmail.com>
The role-based locators pushed those lines past the 80 column print width, which failed `pnpm run fmt:check`. Pure reformatting, no change in behaviour. Signed-off-by: Adegbite Ayoade <tripleaceme@gmail.com>
The per-test `tempDir` fixture removed the directory immediately after the
test body finished. The extension host is often still writing into it at that
point - the language server is shutting down, or uv is finishing a virtual
environment the test created there - so `fs.remove` intermittently failed
with `ENOTEMPTY` and failed an otherwise passing test, e.g.
Error: ENOTEMPTY: directory not empty, rmdir
'.../vscode-test-temp-Ay5Ma1/.venv/lib/python3.11/site-packages/tenacity'
Retry the removal with a backoff and, if it still cannot be removed, warn
instead of failing the test. Cleaning a temporary directory is not what the
test is asserting.
Signed-off-by: Adegbite Ayoade <tripleaceme@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part of #6071. Second of the small fixes out of the reproduction;
test-vscode-e2estaysif: falsehere, since the suite is not green yet.The tempDir fixture removes the directory as soon as the test finishes:
Several tests build a virtualenv inside that directory, and
uvor the language server is sometimes still writing into it when the fixture tears down, which fails the test on an unrelated error:Removal is now retried with a short backoff, and if it still cannot be removed the fixture warns rather than failing the test. A leftover temp directory is a housekeeping problem; failing a test that already passed for it is worse.
This is a flake rather than the systematic failure covered on the issue — the eleven remaining failures are a 60 second timeout against roughly 98 seconds of work, which is a separate decision about the test budget that I have written up on #6071.
Test Plan
The race is timing-dependent, so there is no unit test for it; the change is confined to the fixture's teardown and cannot affect what any test asserts.
Checklist
make styleand fixed any issuesmake fast-test)git commit -s) per the DCO