mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-10-17 04:37:48 +00:00
- RESP -ERR no longer closes healthy conn / aborts batch; global cap replacement-aware - global health-check pass serialized (latent data race); MemoryMonitor via ResourceManager - token-exchange retry, open-circuit rejections counted as failures - TLS-posture matching transport reuse (no silent InsecureSkipVerify handoff)
26 lines
831 B
Go
26 lines
831 B
Go
package recovery
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
// TestRetryExecutor_HighRandomizationNoNegativeDelay guards the R150 fix in
|
|
// RetryExecutor.calculateDelay: with RandomizationFactor > 1 the raw
|
|
// minDelay = delay*(1-RF) is negative, letting time.After(negative)
|
|
// fire immediately and defeating backoff. Delays must be clamped to
|
|
// >= 0.
|
|
func TestRetryExecutor_HighRandomizationNoNegativeDelay(t *testing.T) {
|
|
exec := NewRetryExecutor(RetryConfig{
|
|
InitialDelay: 100 * time.Millisecond,
|
|
MaxDelay: 2 * time.Second,
|
|
Multiplier: 2.0,
|
|
RandomizationFactor: 2.5, // > 1: un-fixed code yields negative delays
|
|
}, &mockLogger{})
|
|
for attempt := 1; attempt <= 2000; attempt++ {
|
|
if d := exec.calculateDelay(attempt); d < 0 {
|
|
t.Fatalf("attempt %d produced negative delay %v", attempt, d)
|
|
}
|
|
}
|
|
}
|