Skip to content

Add the concurrency option to node tests - #64379

Merged
Wesley Wigham (weswigham) merged 6 commits into
microsoft:mainfrom
weswigham:test-concurrency
Sep 23, 2026
Merged

Wesley Wigham (weswigham) merged 6 commits into
microsoft:mainfrom
weswigham:test-concurrency

Conversation

@weswigham

Copy link
Copy Markdown
Member

...When it helps. Running the full API suite with it unconditionally enabled is actually 25% slower - something about running a lot of sync tests at the same time slows it down a lot. So concurrency is only enabled when tests are filtered in some way - but enabling it like that can makes those tests finish in like half the wall-clock time, which is pretty nice.

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.

Copilot review overview

🔵 Needs a closer look

Concurrent execution changes ordering across many large API suites and warrants final human validation for platform-specific races.

Review effort: Balanced
Findings: None

What changed in this PR

Adds selective concurrency to Node.js test suites to accelerate filtered test runs while avoiding full API-suite slowdown.

Changes:

  • Enables concurrency for filtered TypeScript API tests.
  • Runs suitable VS Code extension tests concurrently.
  • Groups standalone tests into concurrent suites.
File Description
packages/​vscode-typescript/​test/​tsdkPackage.test.ts Runs isolated package-resolution tests concurrently.
packages/​vscode-typescript/​test/​contentMapperContributions.test.ts Runs contribution tests concurrently.
packages/​typescript/​test/​wtf8.test.ts Adds conditional concurrency.
packages/​typescript/​test/​sync/​astnav.test.ts Adds conditional concurrency.
packages/​typescript/​test/​sync/​ast.test.ts Adds conditional concurrency across AST suites.
packages/​typescript/​test/​sync/​api.test.ts Adds conditional concurrency across synchronous API suites.
packages/​typescript/​test/​sync/​api-generators.test.ts Adds conditional generator-test concurrency.
packages/​typescript/​test/​spanMap.test.ts Adds conditional concurrency.
packages/​typescript/​test/​encoder.test.ts Adds conditional encoder-test concurrency.
packages/​typescript/​test/​diagnosticFormatter.test.ts Adds conditional formatter-test concurrency.
packages/​typescript/​test/​async/​astnav.test.ts Adds conditional concurrency.
packages/​typescript/​test/​async/​api.test.ts Adds conditional concurrency across asynchronous API suites.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

} from "../src/api/node/protocol.ts";
import { Wtf8Decoder } from "../src/api/node/wtf8.ts";

const concurrency = process.execArgv.some(arg => arg === "--test-name-pattern" || arg.startsWith("--test-name-pattern="));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

On one hand, I'm thinking "we should yoink this into a helper, or describeConcurrent", on the other, "a little copying is better than a little dependency"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, I thought the same, but since the tests are within a few different packages (npm package, vscode extension), either I'd need a common test utils package (....eh?) or at least 2 duplicates, and neither actually has a dedicated test utils file either, so it's a new file in both, too. It's simple enough, so I just shrugged and left it at once per-file it was actually used in.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Actually, because the slowdown-when-fully-concurrent was limited to the API, this is only used in the API in the end, so I guess it's just one test util file 🤷‍♂️

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Sep 23, 2026
@weswigham
Wesley Wigham (weswigham) added this pull request to the merge queue Sep 23, 2026
Merged via the queue into microsoft:main with commit 55a46f1 Sep 23, 2026
29 checks passed
@weswigham
Wesley Wigham (weswigham) deleted the test-concurrency branch September 23, 2026 18:52
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants