File tree Expand file tree Collapse file tree
java-bigquerystorage/google-cloud-bigquerystorage
src/test/java/com/google/cloud/bigquery/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7171 </dependency >
7272
7373 <!-- Test dependencies -->
74+ <dependency >
75+ <groupId >org.awaitility</groupId >
76+ <artifactId >awaitility</artifactId >
77+ <version >4.3.0</version >
78+ <scope >test</scope >
79+ </dependency >
7480 <dependency >
7581 <groupId >junit</groupId >
7682 <artifactId >junit</artifactId >
Original file line number Diff line number Diff line change 193193 <artifactId >opentelemetry-sdk-trace</artifactId >
194194 <scope >test</scope >
195195 </dependency >
196+ <dependency >
197+ <groupId >org.awaitility</groupId >
198+ <artifactId >awaitility</artifactId >
199+ <scope >test</scope >
200+ </dependency >
196201 <dependency >
197202 <groupId >junit</groupId >
198203 <artifactId >junit</artifactId >
Original file line number Diff line number Diff line change 1616
1717package com .google .cloud .bigquery .storage .v1beta1 .it ;
1818
19+ import static org .awaitility .Awaitility .await ;
20+ import com .google .api .gax .rpc .NotFoundException ;
21+ import java .util .Objects ;
22+
1923import static com .google .common .truth .Truth .assertThat ;
2024import static com .google .common .truth .Truth .assertWithMessage ;
2125import static org .junit .jupiter .api .Assertions .assertArrayEquals ;
@@ -1230,7 +1234,13 @@ private void ProcessRowsAtSnapshot(
12301234 TableReadOptions .newBuilder ().setRowRestriction (filter ).build ());
12311235 }
12321236
1233- ReadSession session = client .createReadSession (createSessionRequestBuilder .build ());
1237+ final CreateReadSessionRequest request = createSessionRequestBuilder .build ();
1238+ ReadSession session =
1239+ await ()
1240+ .atMost (Duration .ofSeconds (30 ))
1241+ .pollInterval (Duration .ofSeconds (1 ))
1242+ .ignoreException (NotFoundException .class )
1243+ .until (() -> client .createReadSession (request ), Objects ::nonNull );
12341244 assertEquals (
12351245 1 ,
12361246 session .getStreamsCount (),
Original file line number Diff line number Diff line change 1616
1717package com .google .cloud .bigquery .storage .v1beta2 .it ;
1818
19+ import static org .awaitility .Awaitility .await ;
20+ import com .google .api .gax .rpc .NotFoundException ;
21+ import java .util .Objects ;
22+
1923import static com .google .common .truth .Truth .assertThat ;
2024import static com .google .common .truth .Truth .assertWithMessage ;
2125import static org .junit .jupiter .api .Assertions .assertArrayEquals ;
@@ -1211,7 +1215,13 @@ private void ProcessRowsAtSnapshot(
12111215 .setReadOptions (TableReadOptions .newBuilder ().setRowRestriction (filter ).build ());
12121216 }
12131217
1214- ReadSession session = client .createReadSession (createSessionRequestBuilder .build ());
1218+ final CreateReadSessionRequest request = createSessionRequestBuilder .build ();
1219+ ReadSession session =
1220+ await ()
1221+ .atMost (Duration .ofSeconds (30 ))
1222+ .pollInterval (Duration .ofSeconds (1 ))
1223+ .ignoreException (NotFoundException .class )
1224+ .until (() -> client .createReadSession (request ), Objects ::nonNull );
12151225 assertEquals (
12161226 1 ,
12171227 session .getStreamsCount (),
You can’t perform that action at this time.
0 commit comments