tests(session): improve session table deletion polling and add flaky retries - #18097
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the BigQuery session tests to poll for table deletion with a longer timeout and shorter intervals, and marks the tests as flaky. The reviewer noted that the @pytest.mark.flaky decorator is using incorrect arguments (retries and delay instead of reruns and reruns_delay), which will cause a TypeError during test execution.
shuoweil
force-pushed
the
shuowei-fix-bq-sessions-tests
branch
from
August 13, 2026 00:38
8666413 to
866f523
Compare
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
parthea
approved these changes
Aug 13, 2026
copybara-service Bot
pushed a commit
to google/bigframes
that referenced
this pull request
Aug 18, 2026
Manual copy from PR: googleapis/google-cloud-python#18097 In tests/system/small/test_bq_sessions.py: - test_bq_session_create_temp_table_clustered tests that session temporary tables are deleted after closing the session. Because BigQuery cleans up _SESSION dataset resources asynchronously, during high CI load this can take longer than 60 seconds, causing pytest.raises(NotFound) to fail prematurely. - test_bq_session_create_multi_temp_tables creates 10 concurrent tables across threads and can encounter transient DDL rate limiting or network latency under parallel test execution (pytest-xdist). Changes: 1) Updated test_bq_session_create_temp_table_clustered to poll for table deletion for up to 120s with 5s intervals and assert table_deleted. 2) Added @pytest.mark.flaky(retries=2, delay=10) to both session tests to prevent transient CI test flakes. Fixes: 545778300 Change-Id: I00d720b66319f5f658ce36863d20b10dc4ca9d7d
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.
In
tests/system/small/test_bq_sessions.py:test_bq_session_create_temp_table_clusteredtests that session temporary tables are deleted after closing the session. Because BigQuery cleans up_SESSIONdataset resources asynchronously, during high CI load this can take longer than 60 seconds, causingpytest.raises(NotFound)to fail prematurely.test_bq_session_create_multi_temp_tablescreates 10 concurrent tables across threads and can encounter transient DDL rate limiting or network latency under parallel test execution (pytest-xdist).Changes
test_bq_session_create_temp_table_clusteredto poll for table deletion for up to 120s with 5s intervals and asserttable_deleted.@pytest.mark.flaky(retries=2, delay=10)to both session tests to prevent transient CI test flakes.Fixes #<545778300> 🦕