You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Behavior of maxFailures with last-run.json and CI Test Reruns with --last-failed #33974
I encountered an issue while using Playwright with the maxFailures configuration in our CI pipeline. Here's the scenario:
We have maxFailures set to 3.
When running 70 tests, if the 4th test fails 3 times, Playwright stops execution as per the maxFailures threshold.
The last-run.json file then only contains information about the failed tests (in this case, the 4th test).
When rerunning the job with the --last-failed flag, Playwright only runs the failed test(s) and skips the rest of the tests that were not executed in the initial run.
Is this the expected behavior of Playwright with maxFailures?
Are there alternative configurations or recommendations to ensure all tests are executed in reruns while still using the maxFailures feature?
Expected behavior
I would expect the --last-failed flag to respect the test configuration and include skipped tests from the initial run in the rerun. This would ensure comprehensive test coverage during subsequent executions.
Actual behavior
When rerunning the job with the --last-failed flag, Playwright only runs the failed test(s) and skips the rest of the tests that were not executed in the initial run.
This behavior creates an issue because skipped tests remain untested during reruns.
Activity
yury-s commentedon Dec 12, 2024
This is working as intended - playwright will rerun only tests that are known to have failed during last run.
For comprehensive test coverage you should run without --last-failed, the flag is just an optimization for the development cycle.
Related issue #32254.
jerry23 commentedon Dec 13, 2024
Yury Semikhatsky (@yury-s), Thanks for the clarification.