Chore: Cloudflare cookie test expiring and reddening CI - #325
Merged
Conversation
The test hardcoded a cookie expiry of 13-Jul-26. That date passed on 2026-07-13 16:19:50 GMT, so the cookie became genuinely expired, CookieContainer correctly dropped it, no Cookie header was sent on the follow up request, and the assertion failed. This reds the integration test job on every PR in the repo, on all three platforms. Nothing was wrong with the parsing or with httpbin: the same string with the year moved forward still parses fine, in en-US, es-ES and tr-TR alike. Generate the expiry instead of hardcoding it. It keeps the two digit year, which is the malformed part under test, and is formatted invariant because that is what a server sends, while the thread culture stays set to the test case's culture so the test still covers parsing an English date on a non-English client.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



integration_testis currently failing on every PR in the repo, on all three platforms. It is not infrastructure, and it is not any individual PR's change.Cause
HttpClientFixture.should_parse_malformed_cloudflare_cookiehardcoded a cookie expiry:13-Jul-26parses as 2026-07-13 16:19:50 GMT. That moment has passed, so the cookie is now genuinely expired.CookieContainercorrectly drops it, nothing is stored, noCookieheader goes out on the follow up request, and the assertion on line 814 fails.The test was a time bomb from the day it was written (2015, inherited from Sonarr). It detonated on 2026-07-13.
The CI timeline matches exactly:
integration_testranWhat is not wrong
Worth stating, because the failure looks like both:
Set-Cookieback correctly. With the date fixed, the test passes against the live host as-is.CookieContainer.SetCookiesdirectly: the same cookie string with the year moved forward parses fine, and en-US, es-ES and tr-TR behave identically on .NET 10. Only "expiry in the past" is dropped.Fix
Generate the expiry rather than hardcoding it:
This keeps the two digit year, which is the actual malformed thing under test, and formats invariant because that is what a server sends. The thread culture stays set to the test case's culture, so the test still covers what it was written to cover: parsing an English cookie date on a non-English client.
AddYears(1)also stays clear of the two digit year window (TwoDigitYearMaxis 2049), so it will not resurface for another ~22 years.Testing
Both cases pass, and the full
HttpClientFixtureis green (49/49) against the live host.Notes for follow-up (deliberately not in this PR)
should_reject_malformed_domain_cookiehardcodes23-Dec-2026. It cannot fail the same way, since it asserts the cookie is rejected, and it carriesMax-Agewhich likely takes precedence. But after that date it may start passing for the wrong reason (expired rather than domain mismatch). Worth a look, not urgent.httpbin.servarr.comacross 51 tests / 63 references. That external dependency is real and worth removing in favour of an in-process listener, but it is a project rather than a cleanup and is not what is breaking CI today.