Skip to content

fix(test-runner): run teardown projects when maxFailures is reached#41737

Merged
yury-s merged 3 commits into
microsoft:mainfrom
yury-s:fix-41713
Jul 15, 2026
Merged

fix(test-runner): run teardown projects when maxFailures is reached#41737
yury-s merged 3 commits into
microsoft:mainfrom
yury-s:fix-41713

Conversation

@yury-s

@yury-s yury-s commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Teardown projects were skipped when a run was interrupted by --max-failures, so their cleanup (e.g. clearing a database) never ran.
  • Teardown project test groups are now exempt from the max-failures interruption (via a TestGroup.ignoreMaxFailures flag), so they still run while everything else stops.

Fixes #41713

@yury-s yury-s requested review from dgozman and pavelfeldman July 10, 2026 18:40
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

yury-s added 2 commits July 14, 2026 15:02
When a run is interrupted by maxFailures, teardown projects were skipped,
so their cleanup (e.g. clearing a database) never ran. Exempt teardown
project test groups from the maxFailures interruption via a
TestGroup.ignoreMaxFailures flag so they still run.

Fixes: microsoft#41713
Phase-level ignoreMaxFailures replaces per-test-group tracking and
keeps the dispatcher scheduling logic intact.
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Comment thread packages/playwright/src/runner/tasks.ts
Comment thread tests/playwright-test/max-failures.spec.ts Outdated
Comment thread packages/playwright/src/runner/dispatcher.ts Outdated
@yury-s yury-s merged commit 686830a into microsoft:main Jul 15, 2026
45 of 46 checks passed
@yury-s yury-s deleted the fix-41713 branch July 15, 2026 23:05
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [chrome] › mcp/annotate.spec.ts:110 › should abort annotation when last screenshot is removed @mcp-macos-latest-chrome

7759 passed, 1249 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

🟢 CI is clear — the one failure is a known flake

Hi, I'm the Playwright bot and I took a first look at the CI failures.

The only red on the latest commit (414dab2) is one MCP test, and it's a pre-existing flake unrelated to this PR. tests 1 was still running when I looked, but nothing so far points back to the diff. This PR only touches the test runner's max-failures / teardown scheduling (dispatcher.ts, tasks.ts), which the MCP annotation flow doesn't exercise.

Details

Overall: no failure looks caused by this PR. The single failing test is bimodal across the results DB and fails on many unrelated PRs and push builds.

Pre-existing flake / infra

Nothing to fix here on the PR's side.

Exit, pursued by a bug. 🎭

Triaged by the Playwright bot - agent run

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

6 flaky ⚠️ [chromium-library] › library/video.spec.ts:294 › screencast › should capture navigation `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/chromium/oopif.spec.ts:282 › should click `@realtime-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:356 › screencast › should work for popups `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/video.spec.ts:699 › screencast › should capture full viewport on hidpi `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/video.spec.ts:664 › screencast › should capture full viewport `@chromium-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:827 › should update state on subsequent run `@ubuntu-latest-node22`

49719 passed, 1156 skipped


Merge workflow run.

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