Реализована лабораторная работа 5 на оценку 4

This commit is contained in:
MacBook
2026-11-03 14:05:38 +03:00
parent 276dbdad8a
commit 9db2fa724a
41 changed files with 4267 additions and 37 deletions
+22
View File
@@ -0,0 +1,22 @@
package pipeline
import (
"testing"
"time"
)
func TestRetryDelayBounds(t *testing.T) {
for attempt := 1; attempt <= 20; attempt++ {
bounded := attempt
if bounded > 6 {
bounded = 6
}
base := time.Second * time.Duration(1<<uint(bounded-1))
for i := 0; i < 100; i++ {
got := RetryDelay(attempt)
if got < base || got > base+base/2 {
t.Fatalf("attempt %d: delay %s outside [%s,%s]", attempt, got, base, base+base/2)
}
}
}
}