Skip to content

[12.x] Improve Cache Tests #55670

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

Merged
merged 3 commits into from
May 7, 2025
Merged

Conversation

nuernbergerA
Copy link
Contributor

@nuernbergerA nuernbergerA commented May 7, 2025

Hey,

inspired from today' s stream by @jasonmccreary (about atomic locks and the struggle to test the exception)
i've added a missing test which also can be used as an example on how to test lock/block for other users.

  • Each test had Cache::lock('foo')->forceRelease(); as first line => moved to setUp
  • found a slow test using sleep(2) to test the lock is release afterwards => used Sleep facade which is use in Cache
  • added a missing test for the exception when block runs into a timeout

let me know if i should split this up into more PRs.

cheers
adrian

@jasonmccreary
Copy link
Contributor

Nice follow-up @nuernbergerA!

@taylorotwell taylorotwell merged commit 99debba into laravel:12.x May 7, 2025
60 checks passed
@nuernbergerA nuernbergerA deleted the cache-lock-testing branch May 7, 2025 17:15
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.

3 participants