Jul 5, 2025
0
Level 6
Artisan expectsOutput does not work with parallel testing
Hello guys, hope you do fine.
I have a very weird problem and I have not found any actual documentation around it, looking for, the last 3 hours.
$this->artisan('mycommand')
->expectsOutput('my random output')
->assertExitCode(0);
This will work when running my test as a regular one (without parallel), but it won't work when using php artisan test --parallel , even if i just filter the specific test.
I verified that the output is indeed what I expect, but test won't pass. I believe it has something to do specifically with the parallel execution but can't really get it. It fails with message:
Output "my random output" was not printed.
On my command I just have a regular info call
$this->info("my random output");
Any ideas please?
Please or to participate in this conversation.