Skip to content

test: close TypeScript validators after each test - #469

Merged
robgruen merged 2 commits into
microsoft:mainfrom
yushiwuzhengjianyuzi:fix/463-test-cleanup-ci
Nov 1, 2026
Merged

robgruen merged 2 commits into
microsoft:mainfrom
yushiwuzhengjianyuzi:fix/463-test-cleanup-ci

Conversation

@yushiwuzhengjianyuzi

@yushiwuzhengjianyuzi 与世无争剑宇子 (yushiwuzhengjianyuzi) commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Track validators created by the shared TypeScript test fixture and close them in afterEach, including when assertions fail.
  • Refresh the branch against current main, preserving the contributor's commits and the expanded validator regression suite.

Scope

The Node.js CI change to run npm test already landed in #505. This PR now changes only validator teardown in the test fixture; it preserves the existing CI test step and library/example build coverage.

Why

With TypeScript 7, each validator owns a native compiler process. Releasing each validator after its test prevents compiler processes from accumulating during the suite without changing production validation behavior.

Validation

Verified on Windows with the repository-pinned Node.js 24.22.1:

  • Dependencies restored with npm ci --ignore-scripts; library and example builds then run explicitly.
  • npm test: 219 tests passed, 0 failed.
  • npm run build-all: passed.
  • Focused validator suite with temporary runtime instrumentation: 33 tests passed; all 33 validators closed, with at most one active at a time.
  • Assertion-failure teardown probe: one intentionally failed assertion returned exit code 1, while all 33 validators still closed and none remained open.

Fresh CI verified for head 5541b15:

  • Node.js CI: workspace builds passed, and 219 tests passed with 0 failures on each of Node.js 22.23.4, 24.22.1, and 26.12.1.
  • Python CI: all Pyright and test jobs passed on Python 3.11, 3.12, 3.13, and 3.14.

Closes #463

@yushiwuzhengjianyuzi

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Refresh microsoft#469 against current main after the CI test step landed in microsoft#505. Preserve the contributor's validator lifecycle fix and all current regression tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 1, 2026 23:49
@robgruen robgruen changed the title test: close validators and run regression tests in CI test: close TypeScript validators after each test Nov 1, 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.

🟢 Approval recommended

No active review issues remain for the per-test validator cleanup change.

No open issues 🎉

What changed in this PR

This PR addresses validator cleanup from #463 by adding per-test teardown to the shared TypeScript test fixture. It prevents native compiler processes from accumulating without changing production validation behavior; CI test execution was already addressed in #505.

Changes:

  • Track validators created by the shared helper.
  • Close tracked validators in afterEach, including when assertions fail, while preserving existing regression tests.
File Description
typescript/​test/​validate.test.ts Track test-created validators and close them after each test.

Review effort: Balanced

@robgruen robgruen 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.

Thank you for your contribution!

@robgruen
robgruen merged commit 137c5e1 into microsoft:main Nov 1, 2026
8 checks passed
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.

Clean up TypeScript test validators and run regression tests in CI

3 participants