diff --git a/tests/server/api/api_test.go b/tests/server/api/api_test.go index 314329a614e..b057f8eb657 100644 --- a/tests/server/api/api_test.go +++ b/tests/server/api/api_test.go @@ -925,13 +925,15 @@ func TestRemovingProgress(t *testing.T) { // store 1: 40/10s = 4 // store 2: 20/10s = 2 // average speed = (2+4)/2 = 3.0 - if p.CurrentSpeed != 3.0 { + // If checkStore is executed multiple times, the time windows will increase + // which is 10s, 20s, 30s ..., the corresponding speed will be 3.0, 1.5, 1 ... + if p.CurrentSpeed > 3.0 { return false } // store 1: (20+50)/4 = 17.5s // store 2: (10+40)/2 = 25s // average time = (17.5+25)/2 = 21.25s - if p.LeftSeconds != 21.25 { + if p.LeftSeconds < 21.25 { return false } return true