MCPcopy Create free account
hub / github.com/compozy/agh / TestSettingsRestartTimeout

Function TestSettingsRestartTimeout

internal/cli/update_command_test.go:228–252  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

226}
227
228func 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}

Callers

nothing calls this directly

Calls 2

settingsRestartTimeoutFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected