Skip to content

Commit 8a40ff2

Browse files
authored
test: increase timeout and enable tests on emulator (#1275)
Increase the wait time for a `DatabaseNotFound` error, as it can take a little while before Cloud Spanner actually sends that error for a `SELECT 1` query. Also enable the `ResourceNotFound` tests on the emulator, as the emulator now includes `ResourceInfo` in the returned errors. Fixes #1272
1 parent ffc190c commit 8a40ff2

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseTest.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616

1717
package com.google.cloud.spanner.it;
1818

19-
import static com.google.cloud.spanner.testing.EmulatorSpannerHelper.isUsingEmulator;
2019
import static com.google.common.truth.Truth.assertThat;
2120
import static org.junit.Assert.fail;
22-
import static org.junit.Assume.assumeFalse;
2321

2422
import com.google.api.client.util.ExponentialBackOff;
2523
import com.google.api.gax.longrunning.OperationFuture;
@@ -62,11 +60,6 @@ public void badDdl() {
6260

6361
@Test
6462
public void databaseDeletedTest() throws Exception {
65-
// TODO: Remove the following line once the emulator returns ResourceInfo for Database not found
66-
// errors.
67-
assumeFalse(
68-
"Emulator does not return ResourceInfo for Database not found errors", isUsingEmulator());
69-
7063
// Create a test db, do a query, then delete it and verify that it returns
7164
// DatabaseNotFoundExceptions.
7265
Database db = env.getTestHelper().createTestDatabase();
@@ -83,7 +76,7 @@ public void databaseDeletedTest() throws Exception {
8376
ExponentialBackOff backoff =
8477
new ExponentialBackOff.Builder()
8578
.setInitialIntervalMillis(1000)
86-
.setMaxElapsedTimeMillis(35000)
79+
.setMaxElapsedTimeMillis(65000)
8780
.setMaxIntervalMillis(5000)
8881
.build();
8982
DatabaseNotFoundException notFoundException = null;
@@ -132,11 +125,6 @@ public void databaseDeletedTest() throws Exception {
132125

133126
@Test
134127
public void instanceNotFound() {
135-
// TODO: Remove the following line when the emulator returns ResourceInfo for Instance not found
136-
// errors.
137-
assumeFalse(
138-
"Emulator does not return ResourceInfo for Instance not found errors", isUsingEmulator());
139-
140128
InstanceId testId = env.getTestHelper().getInstanceId();
141129
InstanceId nonExistingInstanceId =
142130
InstanceId.of(testId.getProject(), testId.getInstance() + "-na");

0 commit comments

Comments
 (0)