Skip to content

[8.x] Remove 204 response and instead be explicit with ignores#1187

Merged
taylorotwell merged 6 commits intolaravel:8.xfrom
jackbayliss:example
Feb 25, 2026
Merged

[8.x] Remove 204 response and instead be explicit with ignores#1187
taylorotwell merged 6 commits intolaravel:8.xfrom
jackbayliss:example

Conversation

@jackbayliss
Copy link
Contributor

@jackbayliss jackbayliss commented Feb 25, 2026

Ive had loaaads of flaky tests which made me deep dive this..

The login and logout routes were returning a 204 No Content response. This was originally added to suppress favicon.ico 404 errors appearing in the browser console log via #1061

However, the browser treats a 204 as a "no navigation" response, which means in fast CI it sees it and immediately continues without waiting for the session to be updated. This can cause a race condition see below of my access log:

127.0.0.1 - - [24/Feb/2026:21:02:03 +0000] "GET /_dusk/logout HTTP/2.0" 204 1138 "-" "Laravel/Dusk"
127.0.0.1 - - [24/Feb/2026:21:02:03 +0000] "GET /item/1 HTTP/2.0" 302 1477 "-" "Laravel/Dusk" // This should be logged in... but its been sent away :( 
127.0.0.1 - - [24/Feb/2026:21:02:03 +0000] "GET /login HTTP/2.0" 200 2066 "-" "Laravel/Dusk"

Rather than do a 204 response which causes flakiness, I've just added a way to ignore specific messages, which ignores favicon issues from the browser log, and it also means users can tap into it too. The alternative is to just drop the response and let users worry about the log, but felt nice to add a way to tap into as its prevented atm

TLDR is this stops a huge amount of flaky tests

I've ran this with a local branch for the past few hours and had no flaky tests, where as usually we'd have to re-run the tests 2-5 times per time.

@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.

@jackbayliss jackbayliss marked this pull request as ready for review February 25, 2026 10:33
@taylorotwell taylorotwell merged commit ed25dbb into laravel:8.x Feb 25, 2026
50 checks passed
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