Skip to content

fix(test-runner): run project teardown after max-failures stop#41735

Closed
pradapjackie wants to merge 2 commits into
microsoft:mainfrom
pradapjackie:fix/teardown-max-failures
Closed

fix(test-runner): run project teardown after max-failures stop#41735
pradapjackie wants to merge 2 commits into
microsoft:mainfrom
pradapjackie:fix/teardown-max-failures

Conversation

@pradapjackie

Copy link
Copy Markdown
Contributor

Fixes #41713.

Summary

  • After --max-failures stops the suite, still schedule project teardown projects
  • Add ignoreMaxFailures so teardown phases are not stopped by the max-failures gate
  • Add a regression test for setup → failing test → teardown with --max-failures=1

Motivation

Project teardowns are often used for cleanup (DB, cloud resources). Skipping them when max-failures is hit can leave environments dirty.

Test plan

  • npm run ttest -- tests/playwright-test/max-failures.spec.ts
  • npm run ttest -- tests/playwright-test/deps.spec.ts -g teardown

When --max-failures stops the suite, still schedule teardown projects
so cleanup is not skipped.
Fixes microsoft#41713.
Do not mark teardown tests as interrupted after max-failures has already stopped the suite.
@yury-s

yury-s commented Jul 10, 2026

Copy link
Copy Markdown
Member

Thanks @pradapjackie — closing in favor of #41737. Max-failures touches the dispatcher/phase-scheduling core, so we want to keep iterating on it in-team and get the edge cases right (e.g. teardown sharing a phase with a regular project).

@yury-s yury-s closed this Jul 10, 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.

[Bug]: Teardown is not called if test failure and max-failures configured

2 participants