File tree Expand file tree Collapse file tree 3 files changed +34
-3
lines changed
google-cloud-spanner/src/test/java/com/google/cloud/spanner Expand file tree Collapse file tree 3 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -1521,6 +1521,10 @@ public void testRetryLargeResultSet() {
1521
1521
/** Test the successful retry of a transaction with a high chance of multiple aborts */
1522
1522
@ Test
1523
1523
public void testRetryHighAbortRate () {
1524
+ // TODO(sriharshach): Remove this skip once backend support empty transactions to commit.
1525
+ assumeFalse (
1526
+ "Skipping for multiplexed sessions since it does not allow empty transactions to commit" ,
1527
+ env .getTestHelper ().getOptions ().getSessionPoolOptions ().getUseMultiplexedSessionForRW ());
1524
1528
final int NUMBER_OF_TEST_RECORDS = 10000 ;
1525
1529
final long UPDATED_RECORDS = 1000L ;
1526
1530
// abort on 25% of all statements
Original file line number Diff line number Diff line change @@ -161,7 +161,16 @@ public void testInvalidInsert() throws InterruptedException {
161
161
} catch (ExecutionException e ) {
162
162
assertThat (e .getCause ()).isInstanceOf (SpannerException .class );
163
163
SpannerException se = (SpannerException ) e .getCause ();
164
- assertThat (se .getErrorCode ()).isEqualTo (ErrorCode .NOT_FOUND );
164
+ if (env .getTestHelper ()
165
+ .getOptions ()
166
+ .getSessionPoolOptions ()
167
+ .getUseMultiplexedSessionForRW ()) {
168
+ // Backend currently returns INVALID_ARGUMENT, however this will be changed to NOT_FOUND
169
+ // in future.
170
+ assertThat (se .getErrorCode ()).isAnyOf (ErrorCode .NOT_FOUND , ErrorCode .INVALID_ARGUMENT );
171
+ } else {
172
+ assertThat (se .getErrorCode ()).isEqualTo (ErrorCode .NOT_FOUND );
173
+ }
165
174
// expected
166
175
break ;
167
176
}
Original file line number Diff line number Diff line change @@ -1043,7 +1043,16 @@ public void tableNotFound() {
1043
1043
.build ());
1044
1044
fail ("Expected exception" );
1045
1045
} catch (SpannerException ex ) {
1046
- assertThat (ex .getErrorCode ()).isEqualTo (ErrorCode .NOT_FOUND );
1046
+ if (env .getTestHelper ()
1047
+ .getOptions ()
1048
+ .getSessionPoolOptions ()
1049
+ .getUseMultiplexedSessionForRW ()) {
1050
+ // Backend currently returns INVALID_ARGUMENT, however this will be changed to NOT_FOUND in
1051
+ // future.
1052
+ assertThat (ex .getErrorCode ()).isAnyOf (ErrorCode .NOT_FOUND , ErrorCode .INVALID_ARGUMENT );
1053
+ } else {
1054
+ assertThat (ex .getErrorCode ()).isEqualTo (ErrorCode .NOT_FOUND );
1055
+ }
1047
1056
}
1048
1057
}
1049
1058
@@ -1053,7 +1062,16 @@ public void columnNotFound() {
1053
1062
write (baseInsert ().set ("ColumnThatDoesNotExist" ).to ("V1" ).build ());
1054
1063
fail ("Expected exception" );
1055
1064
} catch (SpannerException ex ) {
1056
- assertThat (ex .getErrorCode ()).isEqualTo (ErrorCode .NOT_FOUND );
1065
+ if (env .getTestHelper ()
1066
+ .getOptions ()
1067
+ .getSessionPoolOptions ()
1068
+ .getUseMultiplexedSessionForRW ()) {
1069
+ // Backend currently returns INVALID_ARGUMENT, however this will be changed to NOT_FOUND in
1070
+ // future.
1071
+ assertThat (ex .getErrorCode ()).isAnyOf (ErrorCode .NOT_FOUND , ErrorCode .INVALID_ARGUMENT );
1072
+ } else {
1073
+ assertThat (ex .getErrorCode ()).isEqualTo (ErrorCode .NOT_FOUND );
1074
+ }
1057
1075
}
1058
1076
}
1059
1077
You can’t perform that action at this time.
0 commit comments