Repository navigation
Tests: the rate tests no longer depend on how fast the loop runs - #85
Merged
Merged
Conversation
…he loop runs (#84) The tests that send a burst and expect a drop let the bucket refill by wall-clock time, so a slow runner could refill it mid-burst. They now hold the refill rate at about zero while the burst is sent; the limits and the burst size are unchanged.
…ign-in burst tests hold theirs (#84)
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.
Fixes #84
The tests that send a burst and expect drops let the token bucket refill by wall-clock time, so a slow runner could refill it mid-burst and nothing was dropped. These tests now hold the refill rate at about zero while the burst is sent. The limits and burst sizes are unchanged, and the "another flow is not affected" check now runs under the same held refill, so a shared bucket would show.
Tests changed: header datagrams count against the flow's rate (test_proxy_protocol), untrusted packet rate per player via proxy and the proxy players' relay budget (test_proxy), and two sign-in burst tests that counted accepted hellos against a refilling bucket (test_proxy, test_auth_limits).
Checked on a slowed process (3 rate tests, 100 runs each): before, 49 failures with a stop/continue pauser and 13 with six busy loops at nice 19; after, 0 and 0. Mutation: with the drop logic removed in a scratch copy, the three burst tests fail. Full suite passes on Python 3.12 and 3.14 (1271 tests).