Skip to content

[net_unittests] Sort cookies for deterministic order - #5217

Merged
kaidokert merged 1 commit into
youtube:25.lts.1+from
msolya:fix_net_test_3
Apr 7, 2025
Merged

kaidokert merged 1 commit into
youtube:25.lts.1+from
msolya:fix_net_test_3

Conversation

@msolya

@msolya msolya commented Mar 27, 2025

Copy link
Copy Markdown
Collaborator

b/219056504

Modified the test to split and sort the cookies before comparing. Previously, a single semicolon-delimited string was compared, but since cookies come from different maps and are sorted by date which may be identical their order can vary between test runs. This change ensures a consistent order for accurate comparisons.

@msolya
msolya requested a review from amurovanyi March 27, 2025 11:28

@amurovanyi amurovanyi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrewsavage1 andrewsavage1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with this going in as is to the 25.lts.1+ branch but we would want a different long-term solution that's shared with Chromium, which is probably making sure the cookies have different timestamps so they're sorted deterministically.

b/219056504

Modified the test to split and sort the cookies before comparing.
Previously, a single semicolon-delimited string was compared, but
since cookies come from different maps and are sorted by date which
may be identical their order can vary between test runs. This change
ensures a consistent order for accurate comparisons.
@kaidokert
kaidokert merged commit b2ea8ed into youtube:25.lts.1+ Apr 7, 2025
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.

4 participants