Skip to content

agentHost: fix Windows identity test flakes - #341581

Merged
roblourens merged 1 commit into
mainfrom
roblou/agents/fix-flaky-tests-issue-341529-341499
Oct 14, 2026
Merged

roblourens merged 1 commit into
mainfrom
roblou/agents/fix-flaky-tests-issue-341529-341499

Conversation

@roblourens

@roblourens roblourens commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Fixes #341529
Fixes #341499

Changes

  • Use the shared bounded-retry filesystem deletion helper for Mission Control initialization records and temporary hard links. Concurrent readers can briefly deny deletion on Windows, causing registration to fail with EPERM.
  • Await all concurrent test hosts before teardown, including when a host fails.
  • Persist one session and evict receipt hash mappings in memory instead of writing 260 durable session records. The original fixture exceeded the Windows CI timeout and then raced teardown against its database journal.
  • Preserve receipt translation checks after eviction and restart, exclusion/revival coverage, and explicitly close the restarted database.
  • Re-enable all six affected cases.

Validation

On macOS:

  • npm run build-fast -- --client-only — passed, including after updating to the latest main.
  • ./scripts/test.sh --run src/vs/platform/agentHost/test/node/missionControlProtocolServer.test.ts --run src/vs/platform/agentHost/test/node/sessionStorageIdentity.test.ts --reporter dot — 194 passed; three existing Windows-only cases skipped.
  • ./scripts/test.sh --run src/vs/platform/agentHost/test/node/missionControlProtocolServer.test.ts --run src/vs/platform/agentHost/test/node/sessionStorageIdentity.test.ts --grep 'concurrent hosts converge|cold central receipt' --reporter dot — repeated 20 times successfully, 120 test passes.
  • ./scripts/test.sh --run src/vs/platform/agentHost/test/node/missionControlProtocolServer.test.ts --run src/vs/platform/agentHost/test/node/sessionStorageIdentity.test.ts --run src/vs/base/test/node/pfs/pfs.test.ts --grep 'Mission Control WPS|Session storage identity compatibility|rimraf' --reporter dot — 202 passed; three existing Windows-only cases skipped.
  • npm run eslint -- src/vs/platform/agentHost/node/missionControl/missionControlEnvironment.ts src/vs/platform/agentHost/test/node/missionControlProtocolServer.test.ts src/vs/platform/agentHost/test/node/sessionStorageIdentity.test.ts — passed.
  • git diff --check — passed.
  • Commit hygiene hook — passed.

CI on commit 362967caf51fb64565d01c47d54c17375f68bc89:

  • Windows / Electron-Unit — passed. All six re-enabled cases and all three Windows-only identity-publication cases passed in both the Electron and Node.js runs. The receipt test completed in 235 ms and 250 ms respectively.
  • Compile & Hygiene and Linux/macOS Electron unit-test jobs — passed.
  • Telemetry, CodeQL, Monaco Editor checks, Component Fixtures, and chat-lib workflows — passed.

No test timeout increases or test retries were added.

(Written by Copilot)

Use bounded filesystem removal retries for concurrent compute identity cleanup and wait for all test hosts before teardown. Exercise receipt hash-cache eviction in memory rather than writing hundreds of durable session records, and re-enable the affected tests.

Fixes #341529
Fixes #341499

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 16:42

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.

🔵 Needs a closer look

No actionable defects were identified, but the Windows-specific sharing failure still needs native CI validation.

0 open findings

What changed in this PR

Addresses Windows identity-test flakes by making filesystem cleanup more resilient and reducing test persistence overhead.

Changes:

  • Use bounded-retry deletion for initialization records and temporary links.
  • Await all concurrent hosts before teardown.
  • Simplify receipt-cache eviction coverage, close the restarted database, and re-enable six tests.
File Description
src/​vs/​platform/​agentHost/​test/​node/​sessionStorageIdentity.test.ts Reduce durable writes while preserving eviction, restart, and revival checks.
src/​vs/​platform/​agentHost/​test/​node/​missionControlProtocolServer.test.ts Re-enable concurrency tests and await all hosts before cleanup.
src/​vs/​platform/​agentHost/​node/​missionControl/​missionControlEnvironment.ts Use shared retrying filesystem deletion.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@roblourens
roblourens marked this pull request as ready for review October 14, 2026 17:11
@roblourens
roblourens enabled auto-merge (squash) October 14, 2026 17:11
@roblourens
roblourens disabled auto-merge October 14, 2026 17:12
@roblourens
roblourens enabled auto-merge (squash) October 14, 2026 17:12
@roblourens
roblourens merged commit 59e0b82 into main Oct 14, 2026
36 checks passed
@roblourens
roblourens deleted the roblou/agents/fix-flaky-tests-issue-341529-341499 branch October 14, 2026 17:13
@vs-code-engineering vs-code-engineering Bot added this to the 1.143.0 milestone Oct 14, 2026
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.

Build failed Flaky Test: cold central receipt translation does not depend on the bounded hash cache

3 participants