Skip to content

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

Description

@svetlalev

Version

1.61.0

Steps to reproduce

Clone this repo https://github.com/atavar3z/pw-teardown-bug.git
run npm install
run npx playwright test --max-failures=1

Expected behavior

I expected the teardown not to be skipped and for the teardown log to be written.

Actual behavior

If tests are run with max-failures configured and number of failures is met then the teardown is skipped.

Additional context

Old bug was closed due to lack of upvotes - #33214
However, I believe this is worth fixing.
Global teardown can be used for things like clearing DB. Not executing the teardown when maxFailures is reached may clog up an environment.
Would be great if you consider it again.

Environment

Environment
System:
OS: Windows 11 10.0.22631
CPU: (8) x64 Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
Memory: 1.01 GB / 7.77 GB
Binaries:
Node: 16.13.0
npm: 8.1.0
IDEs:
VSCode: 1.94.2
Languages:
Bash: 5.0.17
npmPackages:
@playwright/test: ^1.61.0 => 1.61.0

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions