Testing | Blog | Mozex                        [ Skip to content ](#main-content)   [                  ozex Labs ](https://mozex.dev) [About](https://mozex.dev#about) [Projects](https://mozex.dev#projects) [Open Source](https://mozex.dev#open-source) [Services](https://mozex.dev#services) [Docs](https://mozex.dev/docs) [Blog](https://mozex.dev/blog) [ Get in Touch ](https://mozex.dev#contact) 

        [About](https://mozex.dev#about) [Projects](https://mozex.dev#projects) [Open Source](https://mozex.dev#open-source) [Services](https://mozex.dev#services) [Docs](https://mozex.dev/docs) [Blog](https://mozex.dev/blog) [ Get in Touch ](https://mozex.dev#contact) 

     [   Back to Blog ](https://mozex.dev/blog) Tagged: Testing 
=================

     [ Laravel Tests Fail When Two Runs Overlap, Even With --parallel 
----------------------------------------------------------------

 ](https://mozex.dev/blog/29-laravel-tests-fail-when-two-runs-overlap-even-with-parallel) Whenever two test commands ran inside one of my projects at the same time, they failed, because one run would clear the database under the other. It happened especially when I asked a Claude Code session to hand work to sub-agents: each sub-agent ran the tests for its own change, the runs failed, and it became a loop of discovering the problem and running it again. For this post I reproduced it on a fresh Laravel app whose phpunit.xml points at MySQL, with 1,201 tests, 1,200 of them using RefreshDatabase. Run alone, before any fix, the suite passes in under a minute. I started php artisan test twice at the same moment, three times. All six runs failed 1,167 to 1,200 of their 1,201 tests, and each took 3.5 to 4.4 minutes. The fix is my package mozex/laravel-test-lanes. Install it with composer require mozex/laravel-test-lanes --dev and there's nothing else to set up. With it, those runs pass. Everything here ran on Laravel 13.33, PHP 8.5, PHPUnit 12.5 with ParaTest 7.20, and MySQL 8.4 on Windows 11, with version 1.1.1 of the package (Laravel 11 to 13, PHP 8.2+, MySQL, MariaDB and PostgreSQL).

   Sep 30, 2026   ·  7 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ Testing ](https://mozex.dev/blog/tags/testing) [ Open Source ](https://mozex.dev/blog/tags/open-source) [ Database ](https://mozex.dev/blog/tags/database)  

  [ The Laravel Bug Your Tests Will Never Catch 
---------------------------------------------

 ](https://mozex.dev/blog/16-the-laravel-bug-your-tests-will-never-catch) In a previous post, I listed "your job runs before the data exists" as one of five queue failures that only show up in production. I showed the afterCommit() fix and moved on. But that post didn't answer the question that kept nagging me: why do your tests always pass when this bug is sitting right in your code? And where else in your app is this same timing problem hiding, beyond direct dispatch() calls? This post digs into both.

   Apr 15, 2026   ·  7 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ Testing ](https://mozex.dev/blog/tags/testing) [ Database ](https://mozex.dev/blog/tags/database)  

  [ Fixing Pest Sharding for Modular Laravel Applications 
-------------------------------------------------------

 ](https://mozex.dev/blog/2-fixing-pest-sharding-for-modular-laravel-applications) When Pest v4 dropped, one feature got my attention right away: test sharding. My CI pipelines were painfully slow, and splitting tests across parallel GitHub Actions runners seemed like the obvious fix. I upgraded, configured the shards, pushed to CI, and waited. Every shard ran every test. Shard 1 of 4? Full suite. Shard 3 of 4? Full suite. My "optimization" made things four times worse.

   Mar 24, 2026   ·  13 min read   ·  [ Laravel ](https://mozex.dev/blog/tags/laravel) [ PHP ](https://mozex.dev/blog/tags/php) [ Testing ](https://mozex.dev/blog/tags/testing) [ Pest ](https://mozex.dev/blog/tags/pest) [ GitHub Actions ](https://mozex.dev/blog/tags/github-actions)  

###  Stay in the Loop 

 Get the latest posts delivered to your inbox - on your schedule.

   Every New Post Weekly Digest Monthly Digest  

  Subscribe   Subscribing...     No spam. Unsubscribe anytime.

   ![Mozex](https://mozex.dev/images/mozex/profile-256.webp)###  Mozex 

 Laravel Specialist

 Senior Laravel Specialist &amp; Consultant. Building developer tools and open-source packages.

 [   ](https://github.com/mozex) [   ](https://www.linkedin.com/in/mozex) [   ](https://x.com/mozexdev) [   ](https://mozex.dev/blog/feed) 

###  Browse by Topic 

  [ Laravel  21  ](https://mozex.dev/blog/tags/laravel) [ PHP  21  ](https://mozex.dev/blog/tags/php) [ Open Source  7  ](https://mozex.dev/blog/tags/open-source) [ DevOps  5  ](https://mozex.dev/blog/tags/devops) [ Developer Tools  4  ](https://mozex.dev/blog/tags/developer-tools) [ Database  4  ](https://mozex.dev/blog/tags/database) [ AI  4  ](https://mozex.dev/blog/tags/ai) [ Claude Code  3  ](https://mozex.dev/blog/tags/claude-code) [ Testing  3  ](https://mozex.dev/blog/tags/testing) [ Performance  3  ](https://mozex.dev/blog/tags/performance) [ Architecture  3  ](https://mozex.dev/blog/tags/architecture) [ Tutorial  3  ](https://mozex.dev/blog/tags/tutorial) [ Bash  2  ](https://mozex.dev/blog/tags/bash) [ Anthropic  2  ](https://mozex.dev/blog/tags/anthropic) [ WooCommerce  2  ](https://mozex.dev/blog/tags/woocommerce) [ Productivity  1  ](https://mozex.dev/blog/tags/productivity) [ Markdown  1  ](https://mozex.dev/blog/tags/markdown) [ MCP  1  ](https://mozex.dev/blog/tags/mcp) [ GitHub Actions  1  ](https://mozex.dev/blog/tags/github-actions) [ Pest  1  ](https://mozex.dev/blog/tags/pest) [ Code Review  1  ](https://mozex.dev/blog/tags/code-review) [ Windows  1  ](https://mozex.dev/blog/tags/windows)  

###  Need expert Laravel help? 

 I offer consulting, code reviews, and custom development for Laravel applications.

 [ View Services   ](https://mozex.dev#services) 

   Live across open source

  1,351,499+  

 package downloads and counting

  Mozex Labs  [     Iminify, our free image compressor ](https://www.iminify.com) 

 [   ](https://github.com/mozex) [   ](https://www.linkedin.com/in/mozex) [   ](https://x.com/mozexdev) [   ](mailto:hello@mozex.dev) [   ](https://mozex.dev/blog/feed) 

  © 2026 Mozex Labs
