Search code examples
laraveldockersymfonyphpunit

laravel unit tests fail with Symfony\Component\Process\Exception\ProcessSignaledException 11


Trying to figure out what broke my development environment. It had been working well on my MacBook and then I updated something, and now most of my PHPUnit test files throw this error:

Symfony\Component\Process\Exception\ProcessSignaledException
The process has been signaled with signal "11".

Here are my environment details:

Host Environment
   Hardware: MacBook Pro with Apple M3 Pro Chip
   Operating System: macOS Sonoma 14.5
   Docker Desktop: 4.31.0 Engine 26.1.4
Docker Environment
   OS: Ubuntu 22.04.4 LTS
   PHP Version: 8.3.8
   Composer: 2.7.6
   Laravel Framework: 11.4.0
   Laravel Sail: 1.29.1
   PHPUnit: 11.2
   Symfony: ^7.0

These are the things I have tried so far:

  • updated composer and rebuilt composer.lock file
  • pruned docker images and forced docker containers to rebuild with sail command
  • ran artisan commands to wipe, migrate, and re-seed the database as well as clear cache

Symfony throws its error for complex PHPUnit tests (such as those that need to wait for an http response) or for some files that contain multiple simple PHPUnit tests. In some cases I can use the --filter command to individually execute simple PHPUnit tests that are within a file. But when I use the --filter command to select the entire file I get the symfony error for some files. The same files and individual tests fail consistently, but I have not yet determined what is causing the failures. Could this be an issue with how PHPUnit commands are queued?


Solution

  • I rolled back my code changes to a previous commit to verify whether my environment changes were at fault, or if something I had pushed in my code was the culprit. My previous code ran fine despite the various environment changes so it must be something in my code. I diffed the commits and found that in my config/auth.php file I had inadvertently changed the names of one of my auth guards. Repairing the name of the auth guard cleared up all of the process signal errors.

    Just goes to show the value of repository comparison when you start getting all kinds of weird and erratic behavior that the error messages may not help you pinpoint.