MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestLoop_SetRetryConfig

Function TestLoop_SetRetryConfig

internal/loop/loop_test.go:412–437  ·  view source on GitHub ↗

TestLoop_SetRetryConfig tests setting retry config.

(t *testing.T)

Source from the content-addressed store, hash-verified

410
411// TestLoop_SetRetryConfig tests setting retry config.
412func 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.
440func TestLoop_WatchdogDefaultTimeout(t *testing.T) {

Callers

nothing calls this directly

Calls 3

DisableRetryMethod · 0.95
SetRetryConfigMethod · 0.95
NewLoopFunction · 0.85

Tested by

no test coverage detected