Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,10 @@ public void testRetryLargeResultSet() {
/** Test the successful retry of a transaction with a high chance of multiple aborts */
@Test
public void testRetryHighAbortRate() {
// TODO(sriharshach): Remove this skip once backend support empty transactions to commit.
assumeFalse(
"Skipping for multiplexed sessions since it does not allow empty transactions to commit",
env.getTestHelper().getOptions().getSessionPoolOptions().getUseMultiplexedSessionForRW());
final int NUMBER_OF_TEST_RECORDS = 10000;
final long UPDATED_RECORDS = 1000L;
// abort on 25% of all statements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,16 @@ public void testInvalidInsert() throws InterruptedException {
} catch (ExecutionException e) {
assertThat(e.getCause()).isInstanceOf(SpannerException.class);
SpannerException se = (SpannerException) e.getCause();
assertThat(se.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);
if (env.getTestHelper()
.getOptions()
.getSessionPoolOptions()
.getUseMultiplexedSessionForRW()) {
// Backend currently returns INVALID_ARGUMENT, however this will be changed to NOT_FOUND
// in future.
assertThat(se.getErrorCode()).isAnyOf(ErrorCode.NOT_FOUND, ErrorCode.INVALID_ARGUMENT);
} else {
assertThat(se.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);
}
// expected
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,16 @@ public void tableNotFound() {
.build());
fail("Expected exception");
} catch (SpannerException ex) {
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);
if (env.getTestHelper()
.getOptions()
.getSessionPoolOptions()
.getUseMultiplexedSessionForRW()) {
// Backend currently returns INVALID_ARGUMENT, however this will be changed to NOT_FOUND in
// future.
assertThat(ex.getErrorCode()).isAnyOf(ErrorCode.NOT_FOUND, ErrorCode.INVALID_ARGUMENT);
} else {
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);
}
}
}

Expand All @@ -1053,7 +1062,16 @@ public void columnNotFound() {
write(baseInsert().set("ColumnThatDoesNotExist").to("V1").build());
fail("Expected exception");
} catch (SpannerException ex) {
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);
if (env.getTestHelper()
.getOptions()
.getSessionPoolOptions()
.getUseMultiplexedSessionForRW()) {
// Backend currently returns INVALID_ARGUMENT, however this will be changed to NOT_FOUND in
// future.
assertThat(ex.getErrorCode()).isAnyOf(ErrorCode.NOT_FOUND, ErrorCode.INVALID_ARGUMENT);
} else {
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);
}
}
}

Expand Down
Loading