Skip to content

test: run Agent Host E2E as its own test unit in GitHub Actions and ADO - #342346

Merged
Alexandru Dima (alexdima) merged 4 commits into
mainfrom
agents/split-agent-host-e2e-ci-step
Oct 18, 2026
Merged

Alexandru Dima (alexdima) merged 4 commits into
mainfrom
agents/split-agent-host-e2e-ci-step

Conversation

@alexdima

@alexdima Alexandru Dima (alexdima) commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Agent Host E2E moves out of scripts/test-integration.{sh,bat} and becomes its own test unit, with its own script, CI step, timeout and Azure DevOps test ID. It is wired the same way in GitHub Actions and Azure DevOps.

Before After
Script part of scripts/test-integration.{sh,bat} scripts/test-agent-host-e2e.{sh,bat}
GitHub Actions step part of 🧪 Run integration tests (Electron) 🧪 Run Agent Host E2E tests (Electron)
Azure DevOps test ID part of integration-electron integration-agent-host-e2e
Timeout shared with every integration suite its own
ADO rerun checkpoint shared with every integration suite its own

Note

For now, Agent Host E2E still runs on the same machine, as its own step right before 🧪 Run integration tests (Electron). This PR does not move it to a separate job or VM. It is the groundwork that makes that a small follow-up, so E2E can run in parallel with the other integration tests and be retried on its own.

Why

Agent Host E2E is the slowest and the flakiest part of the Electron integration tests. Bundling it with every other integration suite made both problems worse.

It is the long pole

Successful Windows / Electron integration steps in pr.yml, Oct 10–17 (n = 317). Agent Host E2E is skipped when a PR can't affect it, so the runs split cleanly:

Windows 🧪 Run integration tests (Electron) Runs p50 p95 Max Timeout
Agent Host E2E skipped 98 10.4 min 11.8 min 30 min
Agent Host E2E ran 219 26.0 min 28.8 min 29.8 min 30 min

Agent Host E2E adds about 16 minutes at the median, more than all other integration suites combined. With it, 13% of healthy runs took 28 minutes or more of a 30-minute budget.

The split steps in this PR's own CI show the same:

Platform GitHub: Agent Host E2E GitHub: other integration tests ADO: Agent Host E2E ADO: other integration tests
Windows x64 15.8 min 11.8 min 16.9 min 9.1 min
Linux x64 6.9 min 9.1 min 4.3 min 6.5 min
macOS 3.9 min 5.7 min 3.6 min (arm64) 6.3 min (arm64)

It is where the flakes are

All 6 of 6 flaky failures of the Electron integration step from Oct 10–17 trace back to Agent Host E2E. "Flaky" means the job failed, then passed when the same SHA was re-run.

Job Failures What happened
Linux / Electron 4 (1, 2, 3, 4) Every E2E suite passed, then its RAM-disk (tmpfs) cleanup failed (target is busy, held by an orphaned Codex sandbox). #342277 mitigates this; it counted 13 such failures in 10 days, about 1 in 217 PR runs.
Windows / Electron 2 (1, 2) Agent Host E2E took 19.2 and 18.2 minutes. The step then hit its 30-minute timeout 4 and 9 seconds into healthy extension-host suites (Git Base, GitHub Authentication).

Bundling makes it worse

  • Shared time budget. A slow E2E run timed out whichever unrelated suite happened to be running when time ran out. The failure was reported against "integration tests", not against Agent Host E2E.
  • Shared retries. One flaky E2E failure meant rerunning everything. In Azure DevOps, a job rerun repeated the whole integration-electron unit, including about 6–9 minutes of other suites that had already passed.
  • Hidden results. When E2E failed, the script stopped, so the remaining integration suites never ran and their results were unknown.

What this PR gives today

  • Separate timeouts. In GitHub Actions, Agent Host E2E gets 30 minutes on Windows and 15 on Linux and macOS; the other integration tests get 20 minutes everywhere. In Azure DevOps, each step gets 30 minutes.
  • Clear attribution. A failure or timeout now names its unit: 🧪 Run Agent Host E2E tests (Electron) or 🧪 Run integration tests (Electron).
  • Independent retries in Azure DevOps. Each unit records its own checkpoint, so rerunning a failed job skips whichever unit already passed.
  • Both results in GitHub Actions. The integration step still runs after an Agent Host E2E failure, but not after cancellation. In Azure DevOps it keeps the default succeeded() condition, so it is skipped and the job fails, as before.

What it enables next (not in this PR)

  • Run Agent Host E2E in its own job or VM, in parallel with the other integration tests. On Windows, the two would no longer run back to back (26 minutes at p50).
  • Retry it on its own without rerunning the other integration tests. In GitHub Actions this needs the separate job, because "Re-run failed jobs" reruns the whole job.

Changes

  • Scripts.
    • New scripts/test-agent-host-e2e.{sh,bat}. Runs the parallel Agent Host E2E runner (test/integration/agentHost/runner.ts), forwards its options (--jobs, --grep, --build, --tfs), and handles the VSCODE_SKIP_AGENT_HOST_E2E skip. npm run test-agent-host-e2e still works.
    • scripts/test-integration.{sh,bat} no longer run Agent Host E2E. They still exclude its entrypoints from their serial node.js run. --run <one E2E file> still works; the runner uses it for each suite.
  • GitHub Actions (pr-{linux,darwin,win32}-test.yml).
    • A new 🧪 Run Agent Host E2E tests (Electron) step, with the existing change detection and test profile, runs before 🧪 Run integration tests (Electron).
    • The integration step keeps the test profile, because the provider integration tests read it.
  • Azure DevOps, both pipelines below run the two steps on the same machine.
    • Product build (definition 111). A new integration-agent-host-e2e test ID runs before integration-electron in product-build-{linux,darwin,win32}-test.yml. It is registered in testCheckpoint.ts and publish-test-checkpoint.yml, and added next to integration-electron in all 15 job lists.
    • Flaky detection (definition 700). Each iteration of product-smoke-flaky-{linux,darwin,win32}.yml runs an Agent Host E2E step before the integration step.
  • Change detection. detect.ts treats the new scripts as test infrastructure, which forces the full test profile.
  • Guard tests in build/lib/test/.
    • Coverage test. The runner's suite list must be exactly the set of files the integration scripts exclude, and the .sh and .bat scripts must use the same exclusion pattern.
    • Pairing test. Every GitHub Actions or Azure DevOps step that runs test-integration must have an Agent Host E2E step in the same file, with the same command and environment. It covers all 9 such files.
    • Wiring and inventory tests. They pin the GitHub Actions wiring and the Azure DevOps test ID inventory and checkpoints.
  • Docs. The E2E README and the integration-tests and agent-host-e2e-tests skills are updated.

Safety: no tests dropped, and failures still fail CI

The same tests run, checked three ways.

Check Result
Structure The runner's 6 suites are exactly the 6 files the integration scripts exclude; the coverage test enforces this. Compared with main, the only behavioral change in test-integration.{sh,bat} is the removed runner call. The extension-host sections are byte-identical.
Azure DevOps, per suite Published test results from main build 485709 (old flow, same base commit) and 485718 (new flow) have identical result files and per-suite test counts: 3226 tests on macOS, 3222 on Linux, 3879 on Windows.
Local (macOS), same build, only the scripts differ The old and new flows ran the same 1927 test titles (1790 passing, 137 pending). The E2E suites ran exactly once in each flow.

Failures still fail CI, checked by adding failing tests in draft #342386 (do not merge):

Pipeline Agent Host E2E step Integration step Overall
GitHub Actions, all 3 platforms (run) fails, exit 1 still runs, fails, exit 1 job fails
ADO product build (485723), all 3 platforms fails; the test results list the injected test as failed skipped job fails
ADO flaky detection (485724), all 3 platforms exited with code '1' exited with code '1' partially succeeded (continueOnError, as intended)

On Windows, this covers both .bat scripts under GitHub's pwsh and Azure DevOps's exec { }.

Validation

  • Build tests.
    • cd build && node --test lib/test/agentHostTestSelection.test.ts lib/test/testCheckpoint.test.ts lib/test/testCheckpointTemplates.test.ts lib/testAgentHostE2EStartup.test.ts: passed (41/41)
    • Each guard test fails on the gap it guards:
      • The coverage test fails when an unlisted *AgentHostE2E.integrationTest.ts file is added.
      • The pairing test fails on the flaky-detection pipelines without their E2E step.
      • The inventory test fails when integration-agent-host-e2e is removed from one job list.
  • New script, locally (macOS).
    • ./scripts/test-agent-host-e2e.sh --grep "provider session config schema is exposed through AHP": all 6 suites pass, exit 0.
    • With VSCODE_SKIP_AGENT_HOST_E2E=1, the script prints the skip message and exits 0.
    • With an invalid --jobs 0, it exits 1.
  • Lint and syntax. npm run eslint on the changed TypeScript, bash -n on the .sh scripts, and parsing of every changed YAML file: passed.
  • CI on the PR head (9daad9e).
    • GitHub Actions (run): every check passed, including Compile & Hygiene, which runs all build/ tests.
    • ADO product build (485725, VSCODE_BUILD_TYPE=CI, no publishing): succeeded on Windows, Linux and macOS. Both units recorded their own checkpoints.
      • One unrelated Linux smoke test failed on the first attempt and passed on retry: Agents Window (SSH Dev Container AgentHost) timed out waiting for a response.
  • ADO flaky detection (485719, integration only, 2 iterations, on 9cf899d): succeeded. Every iteration ran Agent Host E2E, then the integration tests, and Windows kept its odd/even iteration split. The pipelines haven't changed since.

Copilot AI balanced review requested due to automatic review settings October 17, 2026 23:17

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.

🟡 Changes recommended

The failure fallback needs cancellation guards across all three platforms so superseded integration runs stop promptly.

1 open issue
What changed in this PR

Separates Agent Host E2E tests from other Electron integration tests to give each phase its own timeout and clearer failure reporting.

Changes:

  • Adds dedicated E2E steps across Linux, macOS, and Windows.
  • Preserves test selection and profiles while allowing remaining suites to run after E2E failures.
  • Updates workflow assertions, documentation, and skip messages.
File Description
src/​vs/​platform/​agentHost/​test/​node/​e2e/​README.md Documents the split CI steps.
scripts/​test-integration.sh Clarifies the skip message.
scripts/​test-integration.bat Clarifies the Windows skip message.
build/​lib/​test/​agentHostTestSelection.test.ts Checks the split workflow contract.
.github/​workflows/​pr-win32-test.yml Separates E2E with a 30-minute timeout.
.github/​workflows/​pr-linux-test.yml Separates E2E with a 15-minute timeout.
.github/​workflows/​pr-darwin-test.yml Separates E2E with a 15-minute timeout.

Review effort: Balanced

Comment thread .github/workflows/pr-linux-test.yml Resolved

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.

🟢 Approval recommended

No unresolved findings remain; the focused split preserves selection and cancellation behavior, with contract tests and reported successful cross-platform CI.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

The Agent Host E2E suites ran inside scripts/test-integration.{sh,bat}, so
they shared one step, one timeout and one ADO checkpoint with every other
integration suite. On Windows that step took 23 min at p50 and up to 29.8 min
against a 30 minute timeout, and healthy runs timed out in whichever suite
happened to be running.

- Add scripts/test-agent-host-e2e.{sh,bat}, which run the parallel Agent
  Host E2E runner and own the VSCODE_SKIP_AGENT_HOST_E2E skip.
- scripts/test-integration.{sh,bat} no longer run Agent Host E2E. They keep
  excluding its entrypoints from the serial node.js run, and --run still
  accepts a single E2E file.
- GitHub Actions: a "Run Agent Host E2E tests (Electron)" step runs before
  "Run integration tests (Electron)", on the same runner, with its own
  timeout. The integration tests still run after an E2E failure, but not
  after cancellation.
- ADO: a new integration-agent-host-e2e test ID runs in the same jobs as,
  and before, integration-electron. It has its own checkpoint, so a rerun
  skips whichever unit already passed.
- Change detection treats the new scripts as infrastructure. Tests pin the
  workflow wiring and the ADO test ID inventory, and the docs are updated.

Co-authored-by: Copilot <[email protected]>
@alexdima
Alexandru Dima (alexdima) force-pushed the agents/split-agent-host-e2e-ci-step branch from 41f2ae9 to 9278152 Compare October 18, 2026 09:00
@alexdima Alexandru Dima (alexdima) changed the title ci: run Agent Host E2E in its own integration test step test: run Agent Host E2E as its own test unit in GitHub Actions and ADO Oct 18, 2026

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.

🟡 Changes recommended

Unmigrated flaky-detection pipelines lose Agent Host E2E coverage on all three platforms.

1 open issue

Review effort: Balanced

Comment thread scripts/test-integration.sh Resolved
The flaky-detection pipelines call scripts/test-integration.{sh,bat} in each
iteration, so moving Agent Host E2E out of that script silently dropped it
from their repeated runs on all three platforms.

- Add an Agent Host E2E step before the integration step in each iteration
  of product-smoke-flaky-{linux,darwin,win32}.yml. It has the same
  packaged-product environment, continueOnError and, on Windows, the same
  iteration shard.
- Add a test that every CI step running the integration tests, in GitHub
  Actions or Azure DevOps, has an Agent Host E2E step in the same file with
  the same command and environment. It fails for the three flaky pipelines
  without this change.
- Drop a comment from the ADO E2E steps so the two steps differ only in the
  script they call.

Co-authored-by: Copilot <[email protected]>

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.

🟢 Approval recommended

The execution split, checkpoint wiring, and regression coverage are consistent, with no unresolved findings.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

…ation scripts exclude

test-integration.{sh,bat} exclude the Agent Host E2E entrypoints by glob and
scripts/test-agent-host-e2e runs them from the runner's own list. Assert that
the two sets match, and that both scripts use the same glob, so a new E2E
entrypoint cannot silently stop running.

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants