Skip to content

Commit

Permalink
fix: wait for session pool to initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite committed Dec 18, 2024
1 parent 5109f13 commit 8b14750
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.threeten.bp.Duration;

@RunWith(JUnit4.class)
public class RetryableInternalErrorTest extends AbstractMockServerTest {
Expand All @@ -42,7 +43,11 @@ public void testTranslateInternalException() {
.setChannelConfigurator(ManagedChannelBuilder::usePlaintext)
.setCredentials(NoCredentials.getInstance())
.setSessionPoolOption(
SessionPoolOptions.newBuilder().setMinSessions(1).setMaxSessions(1).build())
SessionPoolOptions.newBuilder()
.setMinSessions(1)
.setMaxSessions(1)
.setWaitForMinSessions(Duration.ofSeconds(1))
.build())
.build()
.getService()) {
DatabaseClient client = spanner.getDatabaseClient(DatabaseId.of("p", "i", "d"));
Expand Down

0 comments on commit 8b14750

Please sign in to comment.