From 0d7d933e91669e3d6adcb7a4f343b199da7608d5 Mon Sep 17 00:00:00 2001 From: Shankar Date: Sun, 19 Apr 2026 00:33:22 +0000 Subject: [PATCH] fix(config): add RetryInterval to TestValidate_ValidConfig + TestValidate_AuthTypeNone fixtures (I-001 follow-up) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: TestValidate_ValidConfig and TestValidate_AuthTypeNone construct a SchedulerConfig without RetryInterval, so Validate() fails the 'retry interval must be at least 1 second' check at config.go:1086 with 'retry interval must be at least 1 second'. Both tests expect success, so they fail whenever run. Root cause (re-derived from source, not inherited from memory): git log -S 'retry interval must be at least' --source --all shows the validation was introduced in 8665b16 (I-001, RetryFailedJobs scheduler wiring). git log -- internal/config/config_test.go shows the test file was last touched in 43e1c89, which predates 8665b16. I-001 added a new Validate() rule without updating the two positive test fixtures — a gap in I-001's verification pass. This is NOT C-001 fallout. The config_test.go file was untouched by the C-001 closure commits 0fb7d46 and d23c268. The failure surfaced during the full test suite run after C-001 landed because no one had run 'go test ./internal/config/...' since I-001. Scope: - internal/config/config_test.go (2 fixtures: TestValidate_ValidConfig, TestValidate_AuthTypeNone). Implementation: Added 'RetryInterval: 5 * time.Minute' to both SchedulerConfig literals. 5 minutes matches the I-001 default at config.go:818: RetryInterval: getEnvDuration("CERTCTL_SCHEDULER_RETRY_INTERVAL", 5*time.Minute) The other two TestValidate_* tests (InvalidAuthType, APIKeyAuth_ MissingSecret) are unaffected because they expect Validate() to error at the auth-type check (line 1052) or auth-secret check (line 1057), both of which fire before the RetryInterval check at line 1086. Verification: - go test -count=1 -run 'TestValidate_' ./internal/config/...: PASS - go test -short -count=1 ./...: all packages PASS - go vet ./...: exit 0 Residual: None. This is a pure test-fixture fix — production code is unchanged. Commit: 8665b16 (I-001) should have included this edit. Attributed here for traceability. --- internal/config/config_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 7e9d7a9..e8bce5c 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -328,6 +328,7 @@ func TestValidate_ValidConfig(t *testing.T) { JobProcessorInterval: 30 * time.Second, AgentHealthCheckInterval: 2 * time.Minute, NotificationProcessInterval: 1 * time.Minute, + RetryInterval: 5 * time.Minute, }, } if err := cfg.Validate(); err != nil { @@ -347,6 +348,7 @@ func TestValidate_AuthTypeNone(t *testing.T) { JobProcessorInterval: 30 * time.Second, AgentHealthCheckInterval: 2 * time.Minute, NotificationProcessInterval: 1 * time.Minute, + RetryInterval: 5 * time.Minute, }, } if err := cfg.Validate(); err != nil {