harden article generation reliability
This commit is contained in:
@@ -31,6 +31,20 @@ func TestNormalizeGenerationTaskRecoveryConfigUsesGenerationDefaults(t *testing.
|
||||
if cfg.MaxAttempts != 3 {
|
||||
t.Fatalf("expected max attempts 3, got %d", cfg.MaxAttempts)
|
||||
}
|
||||
|
||||
stateCheck := normalizeGenerationTaskStateCheckConfig(config.GenerationConfig{})
|
||||
if stateCheck.Interval != 5*time.Minute {
|
||||
t.Fatalf("expected state check interval 5m, got %s", stateCheck.Interval)
|
||||
}
|
||||
if stateCheck.Timeout != 10*time.Second {
|
||||
t.Fatalf("expected state check timeout 10s, got %s", stateCheck.Timeout)
|
||||
}
|
||||
if stateCheck.BatchSize != 100 {
|
||||
t.Fatalf("expected state check batch size 100, got %d", stateCheck.BatchSize)
|
||||
}
|
||||
if stateCheck.Lookback != 24*time.Hour {
|
||||
t.Fatalf("expected state check lookback 24h, got %s", stateCheck.Lookback)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizeGenerationTaskRecoveryConfigKeepsOverrides(t *testing.T) {
|
||||
@@ -52,6 +66,19 @@ func TestNormalizeGenerationTaskRecoveryConfigKeepsOverrides(t *testing.T) {
|
||||
cfg.MaxAttempts != 5 {
|
||||
t.Fatalf("unexpected recovery config: %#v", cfg)
|
||||
}
|
||||
|
||||
stateCheck := normalizeGenerationTaskStateCheckConfig(config.GenerationConfig{
|
||||
TaskStateCheckInterval: 9 * time.Minute,
|
||||
TaskStateCheckTimeout: 11 * time.Second,
|
||||
TaskStateCheckBatchSize: 13,
|
||||
TaskStateCheckLookback: 2 * time.Hour,
|
||||
})
|
||||
if stateCheck.Interval != 9*time.Minute ||
|
||||
stateCheck.Timeout != 11*time.Second ||
|
||||
stateCheck.BatchSize != 13 ||
|
||||
stateCheck.Lookback != 2*time.Hour {
|
||||
t.Fatalf("unexpected state check config: %#v", stateCheck)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGenerationWorkerOwnerIsBounded(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user