test: retry list_query_runs briefly in query_async_polling - #184
Open
eddietejeda wants to merge 1 commit into
Open
test: retry list_query_runs briefly in query_async_polling#184eddietejeda wants to merge 1 commit into
eddietejeda wants to merge 1 commit into
Conversation
The shared sdkci database serves concurrent CI runs, and a run that just reached terminal status can lag out of list_query_runs momentarily — seen on main run 33699871288, where the run succeeded but the immediate listing missed it while two sibling CI runs were active. Poll for up to 10s before declaring the run missing.
eddietejeda
requested review from
rohan-hotdata
and removed request for
a team
September 3, 2026 00:37
| assert time.monotonic() < listing_deadline, ( | ||
| f"query run {query_run_id} not surfaced by list_query_runs" | ||
| ) | ||
| time.sleep(POLL_INTERVAL_S) |
There was a problem hiding this comment.
nit: the list_results assertion at line 99 has the same race (not blocking).
list_results runs against the same shared sdkci-shared database, immediately after the result is created. A result that just became visible can lag out of the listing exactly like a query run does. That assertion still fails on the first miss, so test_query_async_polling can flake again at line 99 for the same reason.
Wrap the list_results call in the same bounded retry, or factor the retry into a small local helper that both listings call.
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.
Deflakes
test_query_async_polling: main run 33699871288 failed because the just-succeeded query run wasn't inlist_query_runsyet — three CI runs had landed on main within 12 seconds and share thesdkci-shareddatabase. The run itself succeeded; only the immediate listing assertion raced. Retry the listing for up to 10s before failing.