Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions google-cloud-jar-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>4.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions java-bigquerystorage/google-cloud-bigquerystorage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@
<artifactId>opentelemetry-sdk-trace</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import static org.awaitility.Awaitility.await;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand All @@ -26,6 +27,7 @@
import static org.junit.jupiter.api.Assertions.fail;

import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.api.gax.rpc.NotFoundException;
import com.google.api.gax.rpc.ServerStream;
import com.google.api.gax.rpc.UnauthenticatedException;
import com.google.auth.oauth2.ServiceAccountCredentials;
Expand Down Expand Up @@ -81,6 +83,7 @@
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import java.util.logging.Logger;
import org.apache.avro.Conversions;
import org.apache.avro.LogicalTypes;
Expand Down Expand Up @@ -1230,7 +1233,15 @@ private void ProcessRowsAtSnapshot(
TableReadOptions.newBuilder().setRowRestriction(filter).build());
}

ReadSession session = client.createReadSession(createSessionRequestBuilder.build());
final CreateReadSessionRequest request = createSessionRequestBuilder.build();
final AtomicReference<ReadSession> sessionRef = new AtomicReference<>();
await()
.atMost(Duration.ofSeconds(10))
.pollInterval(Duration.ofSeconds(1))
// retry if the newly-created table has not yet fully propagated
.ignoreException(NotFoundException.class)
.untilAsserted(() -> sessionRef.set(client.createReadSession(request)));
ReadSession session = sessionRef.get();
assertEquals(
1,
session.getStreamsCount(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import static org.awaitility.Awaitility.await;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand All @@ -26,6 +27,7 @@
import static org.junit.jupiter.api.Assertions.fail;

import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.api.gax.rpc.NotFoundException;
import com.google.api.gax.rpc.ServerStream;
import com.google.api.gax.rpc.UnauthenticatedException;
import com.google.auth.oauth2.ServiceAccountCredentials;
Expand Down Expand Up @@ -77,6 +79,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicReference;
import java.util.logging.Logger;
import org.apache.avro.Conversions;
import org.apache.avro.LogicalTypes;
Expand Down Expand Up @@ -1211,7 +1214,15 @@ private void ProcessRowsAtSnapshot(
.setReadOptions(TableReadOptions.newBuilder().setRowRestriction(filter).build());
}

ReadSession session = client.createReadSession(createSessionRequestBuilder.build());
final CreateReadSessionRequest request = createSessionRequestBuilder.build();
final AtomicReference<ReadSession> sessionRef = new AtomicReference<>();
await()
.atMost(Duration.ofSeconds(10))
.pollInterval(Duration.ofSeconds(1))
// retry if the newly-created table has not yet fully propagated
.ignoreException(NotFoundException.class)
.untilAsserted(() -> sessionRef.set(client.createReadSession(request)));
ReadSession session = sessionRef.get();
assertEquals(
1,
session.getStreamsCount(),
Expand Down
Loading