Skip to content

[12.x] Add option to opt out of parallel safe cache prefix#58801

Merged
taylorotwell merged 8 commits intolaravel:12.xfrom
jackbayliss:12.x-add-option-to-opt-out-of-paralell-cache
Feb 13, 2026
Merged

[12.x] Add option to opt out of parallel safe cache prefix#58801
taylorotwell merged 8 commits intolaravel:12.xfrom
jackbayliss:12.x-add-option-to-opt-out-of-paralell-cache

Conversation

@jackbayliss
Copy link
Contributor

@jackbayliss jackbayliss commented Feb 13, 2026

Applications that intentionally share cache state across parallel test processes cant opt out. This was recently added in the last release.

With this PR it means you can currently control this via LARAVEL_PARALLEL_TESTING_WITHOUT_CACHE.

Open to renaming , but this follows the same as without_databases .

I've intentionally put the option check inside setUpTestCase so people can opt out within their testcases re feedback below..

I'll need to do a PR to collision to allow:
php artisan test --parallel --without_cache - will do that if this is merged..

Thanks!

This closes #58800

@github-actions
Copy link

Thanks for submitting a PR!

Note that draft PRs are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@mgjgid
Copy link

mgjgid commented Feb 13, 2026

Thanks for the quick response!

​Is it possible to support this in the test setup code as well? We’d love to avoid adding it to every command.

@jackbayliss
Copy link
Contributor Author

jackbayliss commented Feb 13, 2026

@mgjgid You can add this to your phpunit.xml:

    <server name="LARAVEL_PARALLEL_TESTING_WITHOUT_CACHE" value="1"/>

or

        $_SERVER['LARAVEL_PARALLEL_TESTING_WITHOUT_CACHE'] = true;

in your setup method (make sure you teardown)

@jackbayliss jackbayliss marked this pull request as ready for review February 13, 2026 17:38
@taylorotwell taylorotwell merged commit 9b46ebd into laravel:12.x Feb 13, 2026
70 checks passed
DarkGhostHunter pushed a commit to DarkGhostHunter/laravel-framework that referenced this pull request Feb 22, 2026
…8801)

* 12.x-option-to-opt-out-of-cache-prefix

* adjust

* adjust

* Update TestCaches.php

* Update TestCaches.php

* inside setUpTestCase for easier opt out

* add test

* cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parallel test cache isolation breaks shared cache (no opt-out available)

3 participants