(t *testing.T)
| 226 | } |
| 227 | |
| 228 | func TestSettingsRestartTimeout(t *testing.T) { |
| 229 | t.Run("Should enforce the restart timeout floor", func(t *testing.T) { |
| 230 | t.Parallel() |
| 231 | |
| 232 | timeout := settingsRestartTimeout(commandDeps{ |
| 233 | startTimeout: 15 * time.Second, |
| 234 | stopTimeout: 15 * time.Second, |
| 235 | }) |
| 236 | if timeout != defaultSettingsRestartTimeout { |
| 237 | t.Fatalf("settingsRestartTimeout() = %s, want %s", timeout, defaultSettingsRestartTimeout) |
| 238 | } |
| 239 | }) |
| 240 | |
| 241 | t.Run("Should extend the timeout when the configured stop and start windows exceed the floor", func(t *testing.T) { |
| 242 | t.Parallel() |
| 243 | |
| 244 | timeout := settingsRestartTimeout(commandDeps{ |
| 245 | startTimeout: 25 * time.Second, |
| 246 | stopTimeout: 25 * time.Second, |
| 247 | }) |
| 248 | if timeout != 55*time.Second { |
| 249 | t.Fatalf("settingsRestartTimeout() = %s, want 55s", timeout) |
| 250 | } |
| 251 | }) |
| 252 | } |
nothing calls this directly
no test coverage detected