Skip to content

test(bigquerystorage): create sessions using await() to address flakiness#13489

Draft
whowes wants to merge 1 commit into
mainfrom
whowes/flaky-11964
Draft

test(bigquerystorage): create sessions using await() to address flakiness#13489
whowes wants to merge 1 commit into
mainfrom
whowes/flaky-11964

Conversation

@whowes

@whowes whowes commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

WIP

Recurring flakes (#11964, #12981) occur when tables created via bigquery.googleapis.com are not immediately available for reading via bigquerystorage.googleapis.com. Add an await()

Fixes #11964

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the Awaitility library as a test dependency and updates the integration tests in both v1beta1 and v1beta2 versions of ITBigQueryStorageTest to poll for read session creation while ignoring NotFoundException. The review feedback suggests using the fully qualified java.time.Duration class name in the await() blocks to prevent potential compilation conflicts with other commonly imported Duration classes.

Comment on lines +1238 to +1243
ReadSession session =
await()
.atMost(Duration.ofSeconds(30))
.pollInterval(Duration.ofSeconds(1))
.ignoreException(NotFoundException.class)
.until(() -> client.createReadSession(request), Objects::nonNull);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

To prevent potential compilation errors due to class name conflicts (e.g., with com.google.protobuf.Duration or org.threeten.bp.Duration which are commonly imported in client library tests), it is safer to use the fully qualified java.time.Duration class name.

Suggested change
ReadSession session =
await()
.atMost(Duration.ofSeconds(30))
.pollInterval(Duration.ofSeconds(1))
.ignoreException(NotFoundException.class)
.until(() -> client.createReadSession(request), Objects::nonNull);
ReadSession session =
await()
.atMost(java.time.Duration.ofSeconds(30))
.pollInterval(java.time.Duration.ofSeconds(1))
.ignoreException(NotFoundException.class)
.until(() -> client.createReadSession(request), Objects::nonNull);

Comment on lines +1219 to +1224
ReadSession session =
await()
.atMost(Duration.ofSeconds(30))
.pollInterval(Duration.ofSeconds(1))
.ignoreException(NotFoundException.class)
.until(() -> client.createReadSession(request), Objects::nonNull);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

To prevent potential compilation errors due to class name conflicts (e.g., with com.google.protobuf.Duration or org.threeten.bp.Duration which are commonly imported in client library tests), it is safer to use the fully qualified java.time.Duration class name.

Suggested change
ReadSession session =
await()
.atMost(Duration.ofSeconds(30))
.pollInterval(Duration.ofSeconds(1))
.ignoreException(NotFoundException.class)
.until(() -> client.createReadSession(request), Objects::nonNull);
ReadSession session =
await()
.atMost(java.time.Duration.ofSeconds(30))
.pollInterval(java.time.Duration.ofSeconds(1))
.ignoreException(NotFoundException.class)
.until(() -> client.createReadSession(request), Objects::nonNull);

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.

[java-bigquerystorage] Flaky ITBigQueryStorageTest test- Failing with Table not found

1 participant