Skip to content

Commit 84d667e

Browse files
Stabilize inline CodeLens test cleanup on Windows (#1913)
## Summary - retry transient Windows filesystem locks when removing the inline CodeLens integration workspace - keep cleanup failures visible after a bounded retry window - document the Windows integration-test cleanup pattern ## Validation - `npm run lint` - `npm run compile-tests` - `npm run unittest` (`2812 passing`, `7 pending`) - `npm run compile` - targeted CodeLens integration suite passed once, then 10 consecutive Windows stress runs passed with no leftover temporary workspaces - deterministic Windows probe reproduced `EBUSY` without retries and verified the bounded retry removes the held directory - full integration run passed the CodeLens suite; an unrelated environment-creation test timed out Fixes #1911 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 9ee9e22 commit 84d667e

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎.github/instructions/testing-workflow.instructions.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,3 +616,4 @@ envConfig.inspect
616616
- **pet binary is required for environment manager registration**: The smoke/E2E/integration tests require the `pet` binary from `microsoft/python-environment-tools` to be built and placed in `python-env-tools/bin/`. Without it, `waitForApiReady()` will timeout because managers never register. CI must build pet from source using `cargo build --release --package pet` (2)
617617
- **Check exact project registration with `getPythonProjects()`**: `getPythonProject(uri)` can return a containing parent project, so it cannot prove that a nested project was registered or unregistered (1)
618618
- **Use controlled fixture providers for package lifecycle integration tests**: Discovering an existing Conda environment does not guarantee API quick-create can succeed. Use `createEnvironmentFixture()` so creation prerequisites and cleanup are deterministic (1)
619+
- **Retry Windows integration-test cleanup at the filesystem operation, not the suite**: After closing VS Code editors, use bounded `fs.rm(..., { recursive: true, force: true, maxRetries, retryDelay })` for temporary workspaces because Windows can briefly return `EBUSY`; keep final failures visible instead of adding sleeps or Mocha retries (1)

‎src/test/integration/inlineScriptCodeLens.integration.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ inlineScriptCodeLensSuite('Integration: Live inline script CodeLens', function (
6161
});
6262

6363
suiteTeardown(async () => {
64-
await fs.rm(root, { recursive: true, force: true });
64+
await fs.rm(root, {
65+
recursive: true,
66+
force: true,
67+
maxRetries: 5,
68+
retryDelay: 100,
69+
});
6570
});
6671

6772
async function lenses(): Promise<vscode.CodeLens[]> {

0 commit comments

Comments
 (0)