feat: add --timeout to bound emulator startup wait#358
Draft
gtsiolis wants to merge 1 commit into
Draft
Conversation
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>
e5fc612 to
47e1c05
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lstk startwaited 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
--timeoutflag tostartthat bounds the existing health-poll wait. It defaults to5mand--timeout 0disables it (wait indefinitely). On timeout the command emits a clear error and exits non-zero instead of hanging.Changes
--timeout(Duration) flag onstart(and the root command, which starts when invoked with no subcommand), threaded throughStartOptions.StartupTimeout.awaitStartupwraps its wait context with the deadline; a deadline hit is surfaced as a typedstartupTimeoutErrorwith an actionableErrorEvent(inspect logs / raise-or-disable the timeout) and telemetry error codestart_timeout.restartand the snapshot auto-start path reuse the same 5m default (bounding the hang there too) without exposing the flag./_localstack/healthand asserts the fast failure.