File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 2121import static org .hamcrest .CoreMatchers .notNullValue ;
2222import static org .hamcrest .MatcherAssert .assertThat ;
2323import static org .junit .Assert .fail ;
24+ import static org .junit .Assume .assumeFalse ;
2425
2526import com .google .cloud .spanner .ErrorCode ;
2627import com .google .cloud .spanner .Mutation ;
@@ -73,6 +74,9 @@ public void test02_WriteMutation() {
7374
7475 @ Test
7576 public void test03_MultipleStatements_WithTimeouts () {
77+ assumeFalse (
78+ "Rolling back a transaction while an update statement is still in flight can cause the transaction to remain active on the emulator" ,
79+ env .getTestHelper ().isEmulator ());
7680 try (ITConnection connection = createConnection ()) {
7781 // do an insert that should succeed
7882 assertThat (
@@ -91,10 +95,9 @@ public void test03_MultipleStatements_WithTimeouts() {
9195 connection .setStatementTimeout (1L , TimeUnit .MILLISECONDS );
9296 try {
9397 connection .executeUpdate (Statement .of ("UPDATE TEST SET NAME='test18' WHERE ID=1000" ));
98+ fail ("missing expected exception" );
9499 } catch (SpannerException e ) {
95- if (e .getErrorCode () != ErrorCode .DEADLINE_EXCEEDED ) {
96- throw e ;
97- }
100+ assertThat (e .getErrorCode (), is (equalTo (ErrorCode .DEADLINE_EXCEEDED )));
98101 }
99102 // remove the timeout setting
100103 connection .clearStatementTimeout ();
You can’t perform that action at this time.
0 commit comments