Repository navigation
Fix DST-sensitive timestamp and cookie expiration tests - #136791
Merged
Merged
Conversation
Compare the local date and time fields preserved by DOS timestamps rather than the timezone offset, matching the existing ZIP tests. Co-authored-by: Copilot App <[email protected]>
Expire the stored cookies directly instead of relying on local wall-clock expiration and delays. Verify that pruning preserves the unexpired cookie and the container count. Co-authored-by: Copilot App <[email protected]>
Discard the date before formatting expected xsd:time values, matching the serializer's current-offset behavior. Cover winter and summer inputs and parse them using the invariant culture. Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
stephentoub
enabled auto-merge (squash)
November 1, 2026 21:16
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the test-only changes targeting DST- and timing-related failures.
No open issues 🎉
What changed in this PR
This test-only PR reduces DST- and timing-related failures in the compression, networking, and XML serialization test suites without changing production code.
Changes:
- Compare ZIP timestamps by local date/time fields rather than offsets that the archive format does not preserve.
- Expire stored cookies directly, removing delays and multithreading requirements while checking counts and surviving cookies.
- Align expected
xsd:timeformatting with date-discarding behavior, use invariant parsing, and add winter/summer inputs.
| File | Description |
|---|---|
| src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs | Adjusts expected time formatting and adds date-bearing test cases. |
| src/libraries/System.Net.Primitives/tests/UnitTests/CookieContainerTest.cs | Makes expiration tests synchronous and deterministic, with stronger assertions. |
| src/libraries/System.IO.Compression/tests/ZipArchive/zip_UpdateTests.cs | Compares timestamp fields preserved by ZIP serialization. |
Review effort: Balanced
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.
These tests can fail across DST transitions or when execution is delayed because they compare timezone information that the serialized formats do not preserve, or wait for short-lived cookies to expire.