TestLoop_SetRetryConfig tests setting retry config.
(t *testing.T)
| 410 | |
| 411 | // TestLoop_SetRetryConfig tests setting retry config. |
| 412 | func TestLoop_SetRetryConfig(t *testing.T) { |
| 413 | l := NewLoop("/test/prd.json", "test", 5, testProvider) |
| 414 | |
| 415 | // Check default |
| 416 | if !l.retryConfig.Enabled { |
| 417 | t.Error("Expected default retry to be enabled") |
| 418 | } |
| 419 | |
| 420 | // Disable retry |
| 421 | l.DisableRetry() |
| 422 | if l.retryConfig.Enabled { |
| 423 | t.Error("Expected retry to be disabled after DisableRetry()") |
| 424 | } |
| 425 | |
| 426 | // Set custom config |
| 427 | customConfig := RetryConfig{ |
| 428 | MaxRetries: 5, |
| 429 | RetryDelays: []time.Duration{time.Second}, |
| 430 | Enabled: true, |
| 431 | } |
| 432 | l.SetRetryConfig(customConfig) |
| 433 | |
| 434 | if l.retryConfig.MaxRetries != 5 { |
| 435 | t.Errorf("Expected MaxRetries 5, got %d", l.retryConfig.MaxRetries) |
| 436 | } |
| 437 | } |
| 438 | |
| 439 | // TestLoop_WatchdogDefaultTimeout tests that the default watchdog timeout is set. |
| 440 | func TestLoop_WatchdogDefaultTimeout(t *testing.T) { |
nothing calls this directly
no test coverage detected