mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-10-27 08:00:13 +00:00
The relay and instance-receive rate limit tests compared TCP application payload against the configured limit, but the limiter charges EasyTier payload including the inner IP and transport headers. That left the 800 KiB/s case only about 2% above its lower bound, so ordinary variance pushed it under (717 vs 720). Count the bytes each limiter charges and assert that rate within 5% instead. TokenBucket now tracks metered bytes, exposed through the limiter trait and hidden test accessors, and the benchmark samples the counter once the initial burst is drained. Keep the payload upper bound, which the encapsulation mismatch does not invalidate, so a limiter whose rejection the forwarding path ignores still fails the test.