What Happened
Our team noticed after upgrading to Pest 4 that our tests running in parallel are showing all tests as passing, but having the overall command fail. However, if we run the exact same test suite sequentially, we get the same number of passing tests and the overall command passes.
Sequential
./vendor/bin/pest --exclude-group=fails-in-parallel --testsuite=Feature --compact
................................................................................................................................................................
............................................................................
Tests: 236 passed (364 assertions)
Duration: 139.51s
echo $?
0
Parallel
./vendor/bin/pest --exclude-group=fails-in-parallel --testsuite=Feature --parallel
................................................................................................................................................................
............................................................................
Tests: 236 passed (364 assertions)
Duration: 30.20s
Parallel: 12 processes
echo $?
2
How to Reproduce
- Run test suite without
--parallel flag and see it passes with the same number of tests and assertions
- Run test suite with
--parallel flag and see it returns an error code of 2, even though it shows the same number of tests and assertions passing successfully
Sample Repository
No response
Pest Version
4.0.3
PHP Version
8.4.11
Operation System
macOS
Notes
I'm not certain if it's related, but I've also noticed that when we run tests in parallel now and there is a test failure, it is swallowing the error and immediately killing the tests without reporting anything about what caused the failure. There was a previous issue #1451 that hinted at their problem could be related to the master process not properly handling the exit codes of the worker threads, which feels like it could be a reason for both of these issues.
What Happened
Our team noticed after upgrading to Pest 4 that our tests running in parallel are showing all tests as passing, but having the overall command fail. However, if we run the exact same test suite sequentially, we get the same number of passing tests and the overall command passes.
Sequential
Parallel
How to Reproduce
--parallelflag and see it passes with the same number of tests and assertions--parallelflag and see it returns an error code of 2, even though it shows the same number of tests and assertions passing successfullySample Repository
No response
Pest Version
4.0.3
PHP Version
8.4.11
Operation System
macOS
Notes
I'm not certain if it's related, but I've also noticed that when we run tests in parallel now and there is a test failure, it is swallowing the error and immediately killing the tests without reporting anything about what caused the failure. There was a previous issue #1451 that hinted at their problem could be related to the master process not properly handling the exit codes of the worker threads, which feels like it could be a reason for both of these issues.