feat(cli): fail fast when async test-session dispatch fails [RED-680]#1420
Open
sorccu wants to merge 1 commit into
Open
feat(cli): fail fast when async test-session dispatch fails [RED-680]#1420sorccu wants to merge 1 commit into
sorccu wants to merge 1 commit into
Conversation
checkly test now runs sessions via POST /v1/test-sessions/run, which dispatches the check runs in the background after the 202. The CLI watches the returned scheduling operation (long-poll with 408 retries, aborted once the run settles) and fails the run immediately with the server's error when dispatch fails — previously a server-side dispatch failure produced no MQTT results and the CLI hung for the full per-check timeout (600s, or 1200s for Playwright) before printing a generic timeout. In --detach mode the CLI confirms dispatch reached a terminal state before detaching, so a dispatch failure still exits non-zero like the synchronous endpoint did. Requires the backend scheduling endpoints (checkly/monorepo#2795) — do not release before they are live in production. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HFcrNm7uzzkD1p87Nf9AhP
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.
Linear: RED-680
What
checkly testcurrently streams results over MQTT and has no way to learn that the backend failed to dispatch the checks — a background scheduling failure leaves the CLI hanging until its own timeout. This PR makes the CLI fail fast:TestSessions.run()now callsPOST /v1/test-sessions/run, whose 202 includes aschedulingIdbacked by a scheduling-operation status row.watchSchedulingpromise pollsGET /v1/test-sessions/scheduling/{schedulingId}/completion(30s long-poll, 408 → retry) and rejects withTestSessionSchedulingFailedError(code: SCHEDULING_ERROR | ABANDONED) the moment dispatch fails — including when the scheduling worker dies and the backend reaper reclaims the operation.--detachawaits scheduling success before emitting DETACH, so a dispatch failure is no longer silently swallowed in detach mode.Behavior notes (accepted)
--detachgains a few seconds of latency (one completion poll round-trip).Backend dependency
Requires the v1 test-session scheduling endpoints from checkly/monorepo#2795 (in the merge queue at the time of writing). Blocked from release — not from merge — until that backend change is live in production: the CLI calls v1 unconditionally, with no fallback to the legacy endpoint (deliberate decision). Merging is safe; releasing before the backend is deployed would break
checkly testfor everyone on the new version.🤖 Generated with Claude Code
https://claude.ai/code/session_01HFcrNm7uzzkD1p87Nf9AhP