Skip to content

[13.x] Speed up slow tests - #62443

Merged
taylorotwell merged 4 commits into
laravel:13.xfrom
JurianArie:improve-test-suite-perf
Nov 12, 2026
Merged

taylorotwell merged 4 commits into
laravel:13.xfrom
JurianArie:improve-test-suite-perf

Conversation

@JurianArie

@JurianArie JurianArie commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Hi, this PR makes the test suite around 50 seconds faster per CI job. On PHP 8.5 with PHPUnit 13 (prefer-stable), it goes from 2:27 to 1:34.

Most time was spent sleeping 😴, and in most cases the sleep could be faked. Bcrypt was also taking multiple seconds, so the tests now use 4 rounds, like the Laravel skeleton.

Below is an AI-generated overview of the performance gain.

Each changed test file run on its own, locally.

Test Before After
Integration/Concurrency/ConcurrencyTest 26.15s 5.19s
Http/HttpClientTest 4.49s 0.46s
Cache/ConcurrencyLimiterTest 4.33s 0.05s
Auth/AuthDatabaseTokenRepositoryTest 2.59s 0.06s
Integration/Auth/AuthenticationTest 2.56s 0.49s
Auth/AuthPasswordBrokerTest 1.29s 0.05s
Integration/Auth/ForgotPasswordTest 1.13s 0.40s
Integration/Database/EloquentModelHashedCastingTest 1.09s 0.39s
Auth/AuthEloquentUserProviderTest 0.91s 0.08s
Auth/AuthDatabaseUserProviderTest 0.86s 0.09s
Integration/Auth/ForgotPasswordWithoutDefaultRoutesTest 0.84s 0.18s
Total 46.2s 7.4s

@taylorotwell
taylorotwell merged commit 49b6ca1 into laravel:13.x Nov 12, 2026
64 checks passed
@JurianArie
JurianArie deleted the improve-test-suite-perf branch November 12, 2026 15:06
binaryfire added a commit to hypervel/components that referenced this pull request Nov 15, 2026
Read the effective BCRYPT_ROUNDS value before falling back to the normal package or framework default. Exported environment values take precedence over the shared PHPUnit default introduced with laravel/framework#62443.

The configuration class with an exported override and the package-mode Testbench contract suite pass.
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.

2 participants