Skip to content

test: reduce flakiness in Copilot Chat sanity tests#319695

Merged
ulugbekna merged 1 commit into
mainfrom
ulugbekna/agents/reduce-flaky-sanity-test
Jun 3, 2026
Merged

test: reduce flakiness in Copilot Chat sanity tests#319695
ulugbekna merged 1 commit into
mainfrom
ulugbekna/agents/reduce-flaky-sanity-test

Conversation

@ulugbekna
Copy link
Copy Markdown
Contributor

The Copilot Chat sanity tests in extensions/copilot hit the live model endpoint, so they can fail for transient upstream reasons (empty response, intermittent rate limiting, model errors) that do not represent an actual regression.

Most recent example: build 444205 failed at macOS (ARM64) attempt 1, where Slash Commands work properly hit:

AssertionError: ok(progressReport.currentProgress)

The /explain request returned, but currentProgress (which only accumulates MarkdownPart/AnchorPart text) was empty. With retries: 1 already configured, both attempts failed and we had zero diagnostics to tell a flake from a real bug.

Changes

  • extensions/copilot/.vscode-test.mjs — bump mocha retries for sanity tests from 1 to 2 (3 attempts total). The suite-level timeout is 1 min per test, and the pipeline job has a 30 min timeout, so this is well within budget.
  • extensions/copilot/src/extension/test/vscode-node/sanity.sanity-test.ts — add a shared describeOutcome(stream, result?) helper used in every assert.ok(currentProgress, …) call site. On failure the assertion message now includes:
    • the stream's item count and the constructor names of each part (so we can see if only non-markdown parts came back),
    • the actual currentProgress value,
    • result.metadata.responseId for correlating with server-side logs,
    • result.errorDetails if the chat handler reported an upstream error (rate limit, content filter, server error — these are returned via the result, not thrown).

Also reuses the helper in the existing agent-mode timeout diagnostics instead of duplicating the dump logic.

Verification

  • tsgo --noEmit --project tsconfig.json in extensions/copilot passes.
  • Pre-commit hygiene hook passes.

cc @lramos15 @roblourens

Related: #312131, #313303, #317255

The Copilot Chat sanity tests in extensions/copilot hit the live
model endpoint, so they can fail for transient upstream reasons such
as empty responses, intermittent rate limiting, or model errors that
do not represent an actual regression.

- Bump mocha retries for sanity tests from 1 to 2 (3 attempts total)
  so a single transient failure no longer fails the build.
- Add a shared describeOutcome() helper that dumps the response
  stream items and any errorDetails into assertion messages, so the
  next failure (after retries are exhausted) carries enough context
  to distinguish a flake from a real bug.
- Reuse the helper in the existing agent-mode timeout diagnostics
  instead of duplicating the dump logic.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 3, 2026 08:20
@ulugbekna ulugbekna enabled auto-merge (squash) June 3, 2026 08:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Reduces flakiness in the Copilot Chat sanity test suite (which hits live model endpoints) by increasing retry budget and improving failure diagnostics so CI logs can distinguish transient upstream failures from real regressions.

Changes:

  • Increase Mocha retries for sanity runs from 1 to 2 (3 total attempts).
  • Add a shared describeOutcome(stream, result?) helper and use it in assertion messages and agent-mode timeout errors to include stream-part breakdown, currentProgress, responseId, and errorDetails.
Show a summary per file
File Description
extensions/copilot/src/extension/test/vscode-node/sanity.sanity-test.ts Adds/uses describeOutcome to enrich assertion and timeout diagnostics for flaky upstream failures.
extensions/copilot/.vscode-test.mjs Increases Mocha retries for sanity tests to allow additional attempts against transient endpoint issues.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 5

@ulugbekna ulugbekna merged commit 5b0a8c2 into main Jun 3, 2026
26 checks passed
@ulugbekna ulugbekna deleted the ulugbekna/agents/reduce-flaky-sanity-test branch June 3, 2026 08:53
@vs-code-engineering vs-code-engineering Bot added this to the 1.124.0 milestone Jun 3, 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.

3 participants