Skip to content

fix(bigquery): Retry stale 404s when querying tables in tests#894

Draft
jmqd wants to merge 4 commits into
mainfrom
jm/bigquery-query-table-404-retry
Draft

fix(bigquery): Retry stale 404s when querying tables in tests#894
jmqd wants to merge 4 commits into
mainfrom
jm/bigquery-query-table-404-retry

Conversation

@jmqd

@jmqd jmqd commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

This fixes flakey test behavior.

A table queried right after being dropped and recreated can return a stale NOT_FOUND while BigQuery metadata propagates. Retry 404s within the existing query budget instead of returning None on the first one. Tables that stay missing for the whole budget still yield None.

jmqd added 3 commits July 10, 2026 17:29
A table queried right after being dropped and recreated can return a
stale NOT_FOUND while BigQuery metadata propagates. Retry 404s within
the existing query budget instead of returning None on the first one.
Tables that stay missing for the whole budget still yield None.
query_table gets a 60 second budget with retry logging, since a view
recreated under the same name can serve stale NOT_FOUND well past the
previous budget. Absence assertions move to a new table_exists helper
backed by the tables metadata API, which answers existence consistently
and without polling.
The six CDC tests assert that delete events emptied the table, which
the table_exists check got wrong since the table legitimately survives.
Poll for an empty query result with the short budget instead; a 404
counts as no rows visible, matching the prior behavior of these
assertions.
@coveralls

coveralls commented Jul 10, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 72.809% (-0.03%) from 72.841% — jm/bigquery-query-table-404-retry into main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants