Skip to content

test: bandwidth limiter feedback-loop convergence tests (#2098) - #3977

Merged
oferchen merged 2 commits into
masterfrom
test/bandwidth-convergence-2098
May 13, 2026
Merged

oferchen merged 2 commits into
masterfrom
test/bandwidth-convergence-2098

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Add convergence tests for the per-stream token-bucket bandwidth limiter verifying rate accuracy under steady-state, step response, burst recovery, multi-stream fairness, underutilization, zero-crossing, and minimum granularity scenarios
  • All 30 tests use the deterministic recorded-sleep infrastructure (no wall-clock jitter) and assert within 5% tolerance of configured rates
  • Covers edge cases: 1 B/s minimum rate, u128 overflow safety, burst-capped limiters, rapid rate oscillation, and mid-transfer configuration changes

Test plan

  • CI passes: fmt + clippy, nextest on Linux/macOS/Windows/musl
  • Verify no timing-dependent flakiness (all assertions use deterministic requested sleep durations)
  • Check that new test module integrates cleanly with existing limiter/tests/ structure

Add convergence tests verifying the token-bucket bandwidth limiter
converges correctly under various load profiles: steady-state at
multiple rates, step response (rate increase/decrease), burst
handling with recovery, multi-stream fairness, feedback accuracy,
underutilization (no unnecessary throttling), zero-crossing
(pause/resume), and minimum granularity (1 B/s, overflow safety).

All tests use the deterministic recorded-sleep infrastructure,
asserting on requested sleep durations to avoid wall-clock jitter.
@github-actions github-actions Bot added the test label May 13, 2026
@oferchen
oferchen merged commit c3f6974 into master May 13, 2026
39 checks passed
@oferchen
oferchen deleted the test/bandwidth-convergence-2098 branch May 13, 2026 11:06
oferchen added a commit that referenced this pull request May 18, 2026
* test: add bandwidth limiter feedback-loop convergence tests

Add convergence tests verifying the token-bucket bandwidth limiter
converges correctly under various load profiles: steady-state at
multiple rates, step response (rate increase/decrease), burst
handling with recovery, multi-stream fairness, feedback accuracy,
underutilization (no unnecessary throttling), zero-crossing
(pause/resume), and minimum granularity (1 B/s, overflow safety).

All tests use the deterministic recorded-sleep infrastructure,
asserting on requested sleep durations to avoid wall-clock jitter.

* style: fix clippy manual_abs_diff in convergence tests
oferchen added a commit that referenced this pull request Aug 24, 2026
* test: add bandwidth limiter feedback-loop convergence tests

Add convergence tests verifying the token-bucket bandwidth limiter
converges correctly under various load profiles: steady-state at
multiple rates, step response (rate increase/decrease), burst
handling with recovery, multi-stream fairness, feedback accuracy,
underutilization (no unnecessary throttling), zero-crossing
(pause/resume), and minimum granularity (1 B/s, overflow safety).

All tests use the deterministic recorded-sleep infrastructure,
asserting on requested sleep durations to avoid wall-clock jitter.

* style: fix clippy manual_abs_diff in convergence tests
oferchen added a commit that referenced this pull request Aug 24, 2026
* test: add bandwidth limiter feedback-loop convergence tests

Add convergence tests verifying the token-bucket bandwidth limiter
converges correctly under various load profiles: steady-state at
multiple rates, step response (rate increase/decrease), burst
handling with recovery, multi-stream fairness, feedback accuracy,
underutilization (no unnecessary throttling), zero-crossing
(pause/resume), and minimum granularity (1 B/s, overflow safety).

All tests use the deterministic recorded-sleep infrastructure,
asserting on requested sleep durations to avoid wall-clock jitter.

* style: fix clippy manual_abs_diff in convergence tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant