diff --git a/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcSqlScriptTest.java b/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcSqlScriptTest.java index 8fc331bb..5133fc4d 100644 --- a/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcSqlScriptTest.java +++ b/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcSqlScriptTest.java @@ -23,6 +23,7 @@ import com.google.cloud.spanner.ErrorCode; import com.google.cloud.spanner.IntegrationTest; +import com.google.cloud.spanner.SpannerException; import com.google.cloud.spanner.connection.SqlScriptVerifier; import com.google.cloud.spanner.jdbc.ITAbstractJdbcTest; import com.google.cloud.spanner.jdbc.JdbcSqlScriptVerifier; @@ -93,6 +94,11 @@ public void test02_InsertTestData() throws Exception { // Ignore, this is expected as errors during a read/write transaction are sticky on the // emulator. } + } catch (SpannerException e) { + if (env.getTestHelper().isEmulator() && e.getErrorCode() == ErrorCode.ALREADY_EXISTS) { + // Ignore, this is expected as errors during a read/write transaction are sticky on the + // emulator. + } } } @@ -114,6 +120,11 @@ public void test04_TestGetCommitTimestamp() throws Exception { && e.getErrorCode() == ErrorCode.INVALID_ARGUMENT.getGrpcStatusCode().value()) { // Ignore as errors during read/write transactions are sticky on the emulator. } + } catch (SpannerException e) { + if (env.getTestHelper().isEmulator() && e.getErrorCode() == ErrorCode.ALREADY_EXISTS) { + // Ignore, this is expected as errors during a read/write transaction are sticky on the + // emulator. + } } }