Skip to content

feat: add --timeout to bound emulator startup wait#358

Draft
gtsiolis wants to merge 1 commit into
mainfrom
pro-357-lstk-start-should-time-out-on-failed-startup-0511
Draft

feat: add --timeout to bound emulator startup wait#358
gtsiolis wants to merge 1 commit into
mainfrom
pro-357-lstk-start-should-time-out-on-failed-startup-0511

Conversation

@gtsiolis

@gtsiolis gtsiolis commented Jul 2, 2026

Copy link
Copy Markdown
Member

lstk start waited indefinitely for the emulator to report healthy, so on the failure path (container never comes up) it would hang CI and other non-interactive jobs until an external timeout killed them.

This adds a --timeout flag to start that bounds the existing health-poll wait. It defaults to 5m and --timeout 0 disables it (wait indefinitely). On timeout the command emits a clear error and exits non-zero instead of hanging.

Changes

  • --timeout (Duration) flag on start (and the root command, which starts when invoked with no subcommand), threaded through StartOptions.StartupTimeout.
  • awaitStartup wraps its wait context with the deadline; a deadline hit is surfaced as a typed startupTimeoutError with an actionable ErrorEvent (inspect logs / raise-or-disable the timeout) and telemetry error code start_timeout.
  • restart and the snapshot auto-start path reuse the same 5m default (bounding the hang there too) without exposing the flag.
  • Unit test for the timeout path plus an integration test that starts a local image which stays running but never serves /_localstack/health and asserts the fast failure.

@gtsiolis gtsiolis self-assigned this Jul 2, 2026
@gtsiolis gtsiolis added semver: patch docs: needed Pull request requires documentation updates labels Jul 2, 2026
lstk start previously waited indefinitely for the emulator to become
healthy, hanging CI on the failure path. Add a --timeout flag (default
5m, 0 disables) that wraps the health-poll wait with a deadline and
fails fast with a clear error and non-zero exit. restart and the
snapshot auto-start path reuse the same default.

Generated with [Linear](https://linear.app/localstack/issue/PRO-357/lstk-start-should-time-out-on-failed-startup#agent-session-92655d31)

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
@gtsiolis gtsiolis force-pushed the pro-357-lstk-start-should-time-out-on-failed-startup-0511 branch from e5fc612 to 47e1c05 Compare July 3, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: needed Pull request requires documentation updates semver: patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant