if you switch to running your tests using mysqlite, do they complete then?
Laravel PHPUnit Testing Issue
Hi I have an rest api application which uses PostgreSQL multi-schema solution to store data base on a subdomain instance.
While running the unit test is hang half way threw after upgrading the application from 5.8 to ^6.0 Laravel.
Further debugging shows it hangs at specific point (around 48% done threw going all the test) when it tries to run migrate:fresh as part of a database migration trait used in the php test file.
The test env uses a database is set up on docker (I tried memory setup too same issue)
The tests has been run individually and they all work fine (passing and everything) just hangs when I try to run them all.
How do I debug it? I tried stepping threw the code not showing anything. Is there a way I can try to print out the migration output or enable some sort of extra login.
I am happy to provide more information if I can but I am not able to share any code.
Edit:
I tried running it on mysqlite but it still hangs
I have debug this further and turns out postgres is locking the transaction casing drop to wait for the release of previous one .
Idk yet how to solve this but at least i got that far
@kbuczynski you may want to look at disabling foreign key constraints when dropping tables.
Schema::disableForeignKeyConstraints();
you could also look at unlocking the table before dropping it.
DB::statement('UNLOCK TABLES;');
Please or to participate in this conversation.