test(bigquerystorage): create sessions using await() to address flakiness#13489
test(bigquerystorage): create sessions using await() to address flakiness#13489whowes wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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.
| ReadSession session = | ||
| await() | ||
| .atMost(Duration.ofSeconds(30)) | ||
| .pollInterval(Duration.ofSeconds(1)) | ||
| .ignoreException(NotFoundException.class) | ||
| .until(() -> client.createReadSession(request), Objects::nonNull); |
There was a problem hiding this comment.
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.
| 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); |
| ReadSession session = | ||
| await() | ||
| .atMost(Duration.ofSeconds(30)) | ||
| .pollInterval(Duration.ofSeconds(1)) | ||
| .ignoreException(NotFoundException.class) | ||
| .until(() -> client.createReadSession(request), Objects::nonNull); |
There was a problem hiding this comment.
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.
| 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); |
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