Repository navigation
Enforce --timeout in query run and run-sql - #73
Merged
Merged
Conversation
They waited with the SDK's WaitGetResults, whose maxRetries counts only errors, so a query that kept running was waited on forever. They now wait with execution.WaitForExecution, the status poll execution results uses, and fetch the rows once it finishes. Amp-Thread-ID: https://ampcode.com/threads/T-01a1f46d-4de8-7404-a66a-7e2a8be6632a Co-authored-by: Amp <amp@ampcode.com>
Contributor
|
@claude review |
…in test Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A transient error on the final results download used to be retried by WaitGetResults; now it fails once. Include the execution ID so the user can fetch the results with dune execution results. Also align the run-sql timeout test with the run one and drop a caller list from the WaitForExecution doc comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
norbertdurcansk
approved these changes
Nov 23, 2026
norbertdurcansk
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Two small follow-ups, both optional: wrap the exec.GetResults() error in waitAndDisplay with the execution ID (WaitGetResults used to retry that call, so a transient 5xx after a long wait now fails with no way to find the execution), and give TestRunSQLStopsAtTheTimeout the same elapsed-time and poll-count assertions as the query run one.
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.
dune query runanddune query run-sqlnow stop waiting at--timeoutand fail withexecution <id> is still EXECUTING after <n>s; .... Before, a query that kept running was waited on forever. Follow-up from Norbert's review of #69.Impact
query runandquery run-sqlwithout--no-wait. They used the SDK'sWaitGetResults, whosemaxRetriescounts only errors.execution.WaitForExecution(exported fromcmd/execution, the status pollexecution resultsuses since Enforce --timeout when waiting for unshaped execution results #69) and then fetch the rows once withGetResults. So the same rules apply: a still-running query fails at the deadline, transient errors (network, 5xx, 429) are retried with a note on stderr, and any other 4xx fails at once.WaitForExecutionnow takes a status function, soexecution resultspassesclient.QueryStatusandquery runpassesexec.GetStatus.Context for reviewers
TestRunStopsAtTheTimeoutchecks that a query stuck in EXECUTING fails within about--timeout, after several status polls.The query test mock now implements
GetStatus/GetResultsinstead ofWaitGetResults; the existing run and run-sql tests are otherwise unchanged and pass.No visual surface: CLI change with no rendered UI; verified with unit tests (
go vet ./...,go test -race ./...).