Skip to content

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
microsoft:mainfrom
vscodebot-pr:fix/agenthost-sdk-downloader-test-timeout-aw-31642289789
Draft

fix: provision AgentSdkDownloader tests with a generous timeout (build fix for vscode-engineering#3401)#330552
VS Code PR Bot (vscodebot-pr) wants to merge 2 commits into
microsoft:mainfrom
vscodebot-pr:fix/agenthost-sdk-downloader-test-timeout-aw-31642289789

Conversation

@vscodebot-pr

@vscodebot-pr VS Code PR Bot (vscodebot-pr) commented Aug 12, 2026

Copy link
Copy Markdown

Build failure

The Windows Run unit tests (node.js) stage failed because several vs/platform/agentHost/test/node/ unit tests exceeded the default 2000ms mocha timeout, e.g.:

  • AgentSdkDownloader loadSdkRoot: reports monotonic download progress ending at totalBytes
  • AgentSdkDownloader loadSdkRoot: cache hit returns immediately without re-downloading
  • AgentSdkDownloader loadSdkRoot: cache dir includes sdkTarget so Universal launches stay separate
  • AgentSdkDownloader loadSdkRoot: concurrent calls in same process share one download

The signature is recurring (not a one-off flake): the same agentHost node suite hit Timeout of 2000ms exceeded across multiple scheduled Windows builds with no correlated source change.

Root cause

The AgentSdkDownloader suite in src/vs/platform/agentHost/test/node/agentSdkDownloader.test.ts contains 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 own this.timeout(15_000); the remaining download/extract tests raced the default. This mirrors the already-fixed SessionDatabase "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 the AgentSdkDownloader suite callback (converted to a function so mocha's this context 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 sibling sessionDatabase.test.ts retry 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: @Giuspepe

Fixes microsoft/vscode-engineering#3401

Generated by build-fix · opus48 · 246.2 AIC · ⌖ 10.9 AIC · ⊞ 11.1K ·

build-fix-driver — cycle 1

Trigger: shim_validation · Head: 5b40acfe9f8 (pushed this cycle)

Item Action
Review on agentSdkDownloader.test.ts:218 — setup-hook timeout only raised the hook deadline (in scope) Fixed in 5b40acf: moved this.timeout(15_000) onto the suite function callback (replied + resolved)
Review on agentSdkDownloader.test.ts:217 — condense inline comment to one line (in scope) Fixed in 5b40acf: condensed rationale to one line (replied + resolved)

Push: yes — 5b40acf · Copilot rerequested: ok

Ready gate: CI pending + Copilot not yet re-run on new HEAD → not marking ready this cycle

Generated by build-fix-driver · opus48 · 172.2 AIC · ⌖ 18.1 AIC · ⊞ 21.8K ·

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 AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/vs/platform/agentHost/test/node/agentSdkDownloader.test.ts Outdated
Comment thread src/vs/platform/agentHost/test/node/agentSdkDownloader.test.ts Outdated
@bryanchen-d Bryan Chen (bryanchen-d) added build-fix PR created by build-fix automation. *build-fix-driving Build-fix driver actively manages this PR. labels Aug 13, 2026
…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>
@vs-code-engineering

Copy link
Copy Markdown
Contributor

Commit pushed: 4adcdf7

Generated by build-fix-driver · opus48 · 172.2 AIC · ⌖ 18.1 AIC · ⊞ 21.8K

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-fix PR created by build-fix automation. *build-fix-driving Build-fix driver actively manages this PR. vscode-build VS Code build process issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants