Skip to content

Conversation

@plietar
Copy link
Member

@plietar plietar commented Apr 9, 2024

The list of packet IDs returned by unpacked() is always sorted lexicographically. Some tests were assuming that this was the same as packet creation order, and were comparing the list of packets against another value for equality.

However, if the packets were created very closely is time, the timestamp part of their packet ID may be equal, in which case the relative order is determined by the random bytes added to the packets. In that case, lexicographical order may not match packet creation order. This is especially likely on Windows where the timer resolution is quite coarse.

@plietar plietar requested review from richfitz and weshinsley and removed request for weshinsley April 9, 2024 13:05
The list of packet IDs returned by `unpacked()` is always sorted
lexicographically. Some tests were assuming that this was the same as
packet creation order, and were comparing the list of packets against
another value for equality.

However, if the packets were created very closely is time, the timestamp
part of their packet ID may be equal, in which case the relative order
is determined by the random bytes added to the packets. In that case,
lexicographical order may not match packet creation order. This is
especially likely on Windows where the timer resolution is quite coarse.
@richfitz richfitz merged commit 3b33da4 into main Apr 9, 2024
@plietar plietar deleted the sort-ids branch April 11, 2024 19:34
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