fix: provision AgentSdkDownloader tests with a generous timeout (build fix for vscode-engineering#3401) - #330552
Draft
VS Code PR Bot (vscodebot-pr) wants to merge 2 commits into
Conversation
The AgentSdkDownloader integration suite runs I/O-bound tests that spin up a loopback HTTP server, download a gzipped tarball, and extract it to disk. On slow Windows CI agents these legitimately exceed the 2000ms mocha default, producing recurring timeout failures. Set a suite-level 15s timeout in the setup hook so all tests are provisioned consistently. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
VS Code PR Bot (vscodebot-pr)
August 12, 2026 21:41
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Attempts to prevent Windows CI timeouts in AgentSdkDownloader integration tests.
Changes:
- Adds a 15-second timeout in the setup hook.
- Documents the slow I/O rationale.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…imeout Set this.timeout(15_000) on the suite callback so it applies to every test runnable (the setup-hook timeout only raised the hook's deadline), and condense the rationale comment to one line per coding guidelines. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Commit pushed:
|
Copilot started reviewing on behalf of
VS Code PR Bot (vscodebot-pr)
August 13, 2026 01:23
View session
Copilot started reviewing on behalf of
VS Code PR Bot (vscodebot-pr)
August 13, 2026 03:14
View session
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.
Build failure
The Windows
Run unit tests (node.js)stage failed because severalvs/platform/agentHost/test/node/unit tests exceeded the default 2000ms mocha timeout, e.g.:AgentSdkDownloader loadSdkRoot: reports monotonic download progress ending at totalBytesAgentSdkDownloader loadSdkRoot: cache hit returns immediately without re-downloadingAgentSdkDownloader loadSdkRoot: cache dir includes sdkTarget so Universal launches stay separateAgentSdkDownloader loadSdkRoot: concurrent calls in same process share one downloadThe signature is recurring (not a one-off flake): the same
agentHostnode suite hitTimeout of 2000ms exceededacross multiple scheduled Windows builds with no correlated source change.Root cause
The
AgentSdkDownloadersuite insrc/vs/platform/agentHost/test/node/agentSdkDownloader.test.tscontains I/O-bound integration tests. Each test spins up a real loopback HTTP server, downloads a gzipped tarball over the socket, and extracts it to a temp directory on disk. On slow Windows CI agents this end-to-end work legitimately exceeds mocha's 2000ms default. Only the explicit cancel test carried its ownthis.timeout(15_000); the remaining download/extract tests raced the default. This mirrors the already-fixedSessionDatabase"retries after a transient initialization failure" test, which was provisioned with an explicit.timeout(10_000)for the same filesystem-latency reason.How the fix works
A suite-level
this.timeout(15_000)is set on theAgentSdkDownloadersuite callback (converted to afunctionso mocha'sthiscontext is bound). Setting the timeout on the suite callback applies it to every test runnable in the suite, so all download/extract tests are provisioned consistently instead of each needing an individual annotation. No production code changes; the tests still exercise the real network → cache → extract flow, and any genuine hang still fails (now at 15s instead of hanging the CI job). Error reporting and assertions are unchanged.Validation
Change is test-only and scoped to a single file. I was unable to run the node unit test suite in this environment (the checkout has no build/test toolchain provisioned and network access is restricted), so validation is by source inspection: the added timeout uses the same established mocha
this.timeout(...)pattern already present in this suite's cancel test and in the siblingsessionDatabase.test.tsretry test.Risk
Very low. Raising a test timeout cannot mask a functional regression — a real defect still fails the assertions; only the deadline for legitimately slow I/O is relaxed. No production code, telemetry, or error handling is touched.
Recommended reviewer
Recommended owner:
@GiuspepeFixes microsoft/vscode-engineering#3401
build-fix-driver — cycle 1
Trigger: shim_validation · Head:
5b40acfe9f8(pushed this cycle)agentSdkDownloader.test.ts:218— setup-hook timeout only raised the hook deadline (in scope)5b40acf: movedthis.timeout(15_000)onto the suitefunctioncallback (replied + resolved)agentSdkDownloader.test.ts:217— condense inline comment to one line (in scope)5b40acf: condensed rationale to one line (replied + resolved)Push: yes —
5b40acf· Copilot rerequested: okReady gate: CI pending + Copilot not yet re-run on new HEAD → not marking ready this cycle