TestLoop_SetWatchdogTimeout tests setting the watchdog timeout.
(t *testing.T)
| 447 | |
| 448 | // TestLoop_SetWatchdogTimeout tests setting the watchdog timeout. |
| 449 | func TestLoop_SetWatchdogTimeout(t *testing.T) { |
| 450 | l := NewLoop("/test/prd.json", "test", 5, testProvider) |
| 451 | |
| 452 | l.SetWatchdogTimeout(10 * time.Minute) |
| 453 | if l.WatchdogTimeout() != 10*time.Minute { |
| 454 | t.Errorf("Expected watchdog timeout 10m, got %v", l.WatchdogTimeout()) |
| 455 | } |
| 456 | |
| 457 | // Setting to 0 disables the watchdog |
| 458 | l.SetWatchdogTimeout(0) |
| 459 | if l.WatchdogTimeout() != 0 { |
| 460 | t.Errorf("Expected watchdog timeout 0 (disabled), got %v", l.WatchdogTimeout()) |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | // TestLoop_WatchdogKillsHungProcess tests that a hung process is killed after timeout. |
| 465 | func TestLoop_WatchdogKillsHungProcess(t *testing.T) { |
nothing calls this directly
no test coverage detected