-
-
Notifications
You must be signed in to change notification settings - Fork 454
Open
Description
Pest Version
4.3.1 (also tested with 3.8.4)
PHP Version
8.3.16 (ZTS Visual C++ 2019 x64)
Operating System
Windows 10/11 (MSYS_NT-10.0-26200)
Description
Running --mutate fails with "Cannot traverse an already closed generator" error on Windows. The tests pass successfully, but mutation testing crashes when it tries to iterate over files.
Steps To Reproduce
- Have a working Pest test suite on Windows
- Add
covers(SomeClass::class)to a test file - Run any of these commands:
./vendor/bin/pest --mutate./vendor/bin/pest --mutate --path=src/Domain./vendor/bin/pest tests/SomeTest.php --mutate
Expected Behavior
Mutation testing should run and report mutants.
Actual Behavior
Tests: 48 passed (150 assertions)
Duration: 6.56s
Mutating application files...
Exception
Cannot traverse an already closed generator
at vendor\pestphp\pest-plugin-mutate\src\Tester\MutationTestRunner.php:124
120▕
121▕ /** @var MutationGenerator $generator */
122▕ $generator = Container::getInstance()->get(MutationGenerator::class);
123▕
➜ 124▕ foreach ($files as $file) {
1 vendor\pestphp\pest-plugin-mutate\src\Tester\MutationTestRunner.php:124
AppendIterator::rewind()
2 vendor\pestphp\pest-plugin-mutate\src\Plugins\Mutate.php:191
Pest\Mutate\Tester\MutationTestRunner::run()
Notes
- Xdebug 3.5.0 is enabled
- Issue occurs with both Pest 3.x and 4.x
- Tests run correctly without
--mutate - Tried with
--parallel,--no-parallel,--no-coverage- same result
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels