Fix Bandwith Limiter Panic (#11988)

This commit is contained in:
Nishant Das
2023-02-14 13:44:20 +08:00
committed by GitHub
parent 93298dfc56
commit 449d767294
2 changed files with 14 additions and 0 deletions

View File

@@ -914,6 +914,14 @@ func TestTimeToWait(t *testing.T) {
timeTillEmpty: 200 * time.Second,
want: 0 * time.Second,
},
{
name: "Limiter has full capacity remaining",
wanted: 350,
rem: 320,
capacity: 320,
timeTillEmpty: 0 * time.Second,
want: 0 * time.Second,
},
{
name: "Limiter has reached full capacity",
wanted: 64,