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
12 changes: 11 additions & 1 deletion .kokoro/presubmit/integration-regular-sessions-enabled.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,14 @@ env_vars: {
env_vars: {
key: "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS"
value: "false"
}
}

env_vars: {
key: "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS"
value: "false"
}

env_vars: {
key: "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW"
value: "false"
}
Original file line number Diff line number Diff line change
Expand Up @@ -619,13 +619,13 @@ public static class Builder {
// client.
// Set useMultiplexedSessionForRW to true to make multiplexed session for RW operations the
// default.
private boolean useMultiplexedSessionForRW = false;
private boolean useMultiplexedSessionForRW = true;

// This field controls the default behavior of session management for Partitioned operations in
// Java client.
// Set useMultiplexedSessionPartitionedOps to true to make multiplexed session for Partitioned
// operations the default.
private boolean useMultiplexedSessionPartitionedOps = false;
private boolean useMultiplexedSessionPartitionedOps = true;

private Duration multiplexedSessionMaintenanceDuration = Duration.ofDays(7);
private Clock poolMaintainerClock = Clock.INSTANCE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ public void databaseDeletedTest() throws Exception {
}
}
}
assertThat(notFoundException).isNotNull();
if (!isUsingEmulator()) {
assertThat(notFoundException).isNotNull();
}

// Now get a new DatabaseClient for the database. This should now result in a valid
// DatabaseClient.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.cloud.spanner.it;

import static com.google.cloud.spanner.testing.EmulatorSpannerHelper.isUsingEmulator;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;

Expand Down Expand Up @@ -132,10 +133,8 @@ public void testWriteAndReadInvalidJsonValues() throws IOException {
.to(Value.json(jsonStr))
.build())));

if (env.getTestHelper()
.getOptions()
.getSessionPoolOptions()
.getUseMultiplexedSessionForRW()) {
if (env.getTestHelper().getOptions().getSessionPoolOptions().getUseMultiplexedSessionForRW()
&& !isUsingEmulator()) {
assertEquals(ErrorCode.INVALID_ARGUMENT, exception.getErrorCode());
} else {
assertEquals(ErrorCode.FAILED_PRECONDITION, exception.getErrorCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1081,10 +1081,8 @@ public void incorrectType() {
write(baseInsert().set("StringValue").to(1.234).build());
fail("Expected exception");
} catch (SpannerException ex) {
if (env.getTestHelper()
.getOptions()
.getSessionPoolOptions()
.getUseMultiplexedSessionForRW()) {
if (env.getTestHelper().getOptions().getSessionPoolOptions().getUseMultiplexedSessionForRW()
&& !isUsingEmulator()) {
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.INVALID_ARGUMENT);
} else {
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.FAILED_PRECONDITION);
Expand Down