Skip to content

fix(vscode): retry temp directory cleanup in the e2e fixture - #6094

Open
tripleaceme wants to merge 7 commits into
SQLMesh:mainfrom
tripleaceme:fix/vscode-e2e-teardown
Open

tripleaceme wants to merge 7 commits into
SQLMesh:mainfrom
tripleaceme:fix/vscode-e2e-teardown

Conversation

@tripleaceme

Copy link
Copy Markdown
Contributor

Description

Part of #6071. Second of the small fixes out of the reproduction; test-vscode-e2e stays if: false here, since the suite is not green yet.

The tempDir fixture removes the directory as soon as the test finishes:

await use(tempDir)
...
await fs.remove(tempDir)

Several tests build a virtualenv inside that directory, and uv or the language server is sometimes still writing into it when the fixture tears down, which fails the test on an unrelated error:

ENOTEMPTY: directory not empty, rmdir '.../.venv/lib/python3.11/site-packages/tenacity'

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

pnpm run lint                    # ui-style: prettier + eslint + tsc, all workspaces
pnpm run ci (vscode/extension)   # test-vscode: eslint, tsc --noEmit, vitest
19 tests passed (4 files)

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

  • I have run make style and fixed any issues
  • I have added tests for my changes (if applicable)
  • All existing tests pass (make fast-test)
  • My commits are signed off (git commit -s) per the DCO

tripleaceme and others added 7 commits September 18, 2026 02:51
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants