5759c1862e
M0-M7 已完成:核心网关(身份/RBAC/TOTP/OIDC/SAML/Provider/配额/路由/内容策略/审计/定价)+ 资源市场(MCP/Skills/数字员工)。 含 22 个 PostgreSQL 迁移、管理端/门户端前端源码、OpenAPI 契约、部署 compose。 Co-Authored-By: Claude <noreply@anthropic.com>
19 lines
436 B
Go
19 lines
436 B
Go
package outbox
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestRetryDelayIsExponentialAndCapped(t *testing.T) {
|
|
tests := []struct {
|
|
attempt int
|
|
want time.Duration
|
|
}{{1, time.Second}, {2, 2 * time.Second}, {3, 4 * time.Second}, {20, 5 * time.Second}}
|
|
for _, test := range tests {
|
|
if got := retryDelay(test.attempt, 5*time.Second); got != test.want {
|
|
t.Fatalf("attempt %d: got %s, want %s", test.attempt, got, test.want)
|
|
}
|
|
}
|
|
}
|