File tree Expand file tree Collapse file tree 5 files changed +21
-12
lines changed
main/java/com/google/cloud/spanner
test/java/com/google/cloud/spanner/it Expand file tree Collapse file tree 5 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -35,4 +35,14 @@ env_vars: {
35
35
env_vars: {
36
36
key: " GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS"
37
37
value: " false"
38
- }
38
+ }
39
+
40
+ env_vars: {
41
+ key: " GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS"
42
+ value: " false"
43
+ }
44
+
45
+ env_vars: {
46
+ key: " GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW"
47
+ value: " false"
48
+ }
Original file line number Diff line number Diff line change @@ -619,13 +619,13 @@ public static class Builder {
619
619
// client.
620
620
// Set useMultiplexedSessionForRW to true to make multiplexed session for RW operations the
621
621
// default.
622
- private boolean useMultiplexedSessionForRW = false ;
622
+ private boolean useMultiplexedSessionForRW = true ;
623
623
624
624
// This field controls the default behavior of session management for Partitioned operations in
625
625
// Java client.
626
626
// Set useMultiplexedSessionPartitionedOps to true to make multiplexed session for Partitioned
627
627
// operations the default.
628
- private boolean useMultiplexedSessionPartitionedOps = false ;
628
+ private boolean useMultiplexedSessionPartitionedOps = true ;
629
629
630
630
private Duration multiplexedSessionMaintenanceDuration = Duration .ofDays (7 );
631
631
private Clock poolMaintainerClock = Clock .INSTANCE ;
Original file line number Diff line number Diff line change @@ -150,7 +150,9 @@ public void databaseDeletedTest() throws Exception {
150
150
}
151
151
}
152
152
}
153
- assertThat (notFoundException ).isNotNull ();
153
+ if (!isUsingEmulator ()) {
154
+ assertThat (notFoundException ).isNotNull ();
155
+ }
154
156
155
157
// Now get a new DatabaseClient for the database. This should now result in a valid
156
158
// DatabaseClient.
Original file line number Diff line number Diff line change 16
16
17
17
package com .google .cloud .spanner .it ;
18
18
19
+ import static com .google .cloud .spanner .testing .EmulatorSpannerHelper .isUsingEmulator ;
19
20
import static org .junit .Assert .assertEquals ;
20
21
import static org .junit .Assert .assertThrows ;
21
22
@@ -132,10 +133,8 @@ public void testWriteAndReadInvalidJsonValues() throws IOException {
132
133
.to (Value .json (jsonStr ))
133
134
.build ())));
134
135
135
- if (env .getTestHelper ()
136
- .getOptions ()
137
- .getSessionPoolOptions ()
138
- .getUseMultiplexedSessionForRW ()) {
136
+ if (env .getTestHelper ().getOptions ().getSessionPoolOptions ().getUseMultiplexedSessionForRW ()
137
+ && !isUsingEmulator ()) {
139
138
assertEquals (ErrorCode .INVALID_ARGUMENT , exception .getErrorCode ());
140
139
} else {
141
140
assertEquals (ErrorCode .FAILED_PRECONDITION , exception .getErrorCode ());
Original file line number Diff line number Diff line change @@ -1081,10 +1081,8 @@ public void incorrectType() {
1081
1081
write (baseInsert ().set ("StringValue" ).to (1.234 ).build ());
1082
1082
fail ("Expected exception" );
1083
1083
} catch (SpannerException ex ) {
1084
- if (env .getTestHelper ()
1085
- .getOptions ()
1086
- .getSessionPoolOptions ()
1087
- .getUseMultiplexedSessionForRW ()) {
1084
+ if (env .getTestHelper ().getOptions ().getSessionPoolOptions ().getUseMultiplexedSessionForRW ()
1085
+ && !isUsingEmulator ()) {
1088
1086
assertThat (ex .getErrorCode ()).isEqualTo (ErrorCode .INVALID_ARGUMENT );
1089
1087
} else {
1090
1088
assertThat (ex .getErrorCode ()).isEqualTo (ErrorCode .FAILED_PRECONDITION );
You can’t perform that action at this time.
0 commit comments