Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"recreate-databases" is not working with "parallel" tests #50840

Closed
AnourValar opened this issue Mar 29, 2024 · 6 comments
Closed

"recreate-databases" is not working with "parallel" tests #50840

AnourValar opened this issue Mar 29, 2024 · 6 comments
Assignees

Comments

@AnourValar
Copy link

Laravel Version

11.1.1

PHP Version

8.3

Database Driver & Version

PostgreSQL 15.1

Description

php artisan test ignores the option "--recreate-databases".

This code won't be called:
ParallelTesting::setUpTestDatabase(fn () => dd('foo'));

Steps To Reproduce

Run tests with the command:
php artisan test --parallel --recreate-databases --processes=3

@driesvints
Copy link
Member

This flag isn't supposed to be combined with parallel testing.

@AnourValar
Copy link
Author

AnourValar commented Mar 29, 2024

@driesvints ,

  1. parallel & recreate-databases features worked together a few month ago
  2. Official Laravel document says it should work: https://laravel.com/docs/11.x/testing#parallel-testing-and-databases

image

@driesvints
Copy link
Member

driesvints commented Mar 29, 2024

Hah, you got me there, sorry. In my mind it seemed odd to recreate databases while parallel testing is already constantly recreating them.

I'll re-open this but would appreciate some help figuring this one out.

Copy link

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

@nunomaduro
Copy link
Member

Any of your tests uses the "RefreshDatabase" trait?

@nunomaduro nunomaduro self-assigned this Mar 29, 2024
@AnourValar
Copy link
Author

AnourValar commented Mar 29, 2024

I'm sorry.. This bug is not related with Laravel.

I have this issue because I installed pest-plugin-stressless, but continued using Phpunit as a test framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants