Skip to content

Commit

Permalink
test: quick start sample test did not wait for database creation to f…
Browse files Browse the repository at this point in the history
…inish (#758)
  • Loading branch information
olavloite committed Dec 16, 2020
1 parent cd946d7 commit 0f7658d
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -25,6 +25,7 @@
import java.io.PrintStream;
import java.util.Collections;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
Expand All @@ -49,12 +50,12 @@ public class QuickstartSampleIT {
private PrintStream out;

@BeforeClass
public static void createDatabase() {
public static void createDatabase() throws InterruptedException, ExecutionException {
final SpannerOptions options =
SpannerOptions.newBuilder().setAutoThrottleAdministrativeRequests().build();
spanner = options.getService();
dbClient = spanner.getDatabaseAdminClient();
dbClient.createDatabase(instanceId, dbId, Collections.emptyList());
dbClient.createDatabase(instanceId, dbId, Collections.emptyList()).get();
}

@AfterClass
Expand Down

0 comments on commit 0f7658d

Please sign in to comment.