Skip to content

Commit ce00b17

Browse files
authored
deps: bump Spanner to 6.72.0 (googleapis#1698)
1 parent 828aff6 commit ce00b17

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<dependency>
6262
<groupId>com.google.cloud</groupId>
6363
<artifactId>google-cloud-spanner-bom</artifactId>
64-
<version>6.71.0</version>
64+
<version>6.72.0</version>
6565
<type>pom</type>
6666
<scope>import</scope>
6767
</dependency>

src/test/java/com/google/cloud/spanner/jdbc/JdbcConnectionUrlTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package com.google.cloud.spanner.jdbc;
1818

19-
import static com.google.common.truth.Truth.assertThat;
19+
import static org.junit.Assert.assertEquals;
2020
import static org.junit.Assert.assertTrue;
2121

2222
import com.google.cloud.spanner.connection.AbstractMockServerTest;
@@ -103,7 +103,10 @@ public void testMaxSessions()
103103
executor1.shutdown();
104104
executor2.shutdown();
105105
}
106-
assertThat(mockSpanner.numSessionsCreated()).isEqualTo(1);
106+
assertEquals(1, mockSpanner.countRequestsOfType(BatchCreateSessionsRequest.class));
107+
BatchCreateSessionsRequest request =
108+
mockSpanner.getRequestsOfType(BatchCreateSessionsRequest.class).get(0);
109+
assertEquals(1, request.getSessionCount());
107110
}
108111
}
109112
}

src/test/java/com/google/cloud/spanner/jdbc/MultiplexedSessionsMockServerTest.java

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.google.cloud.spanner.MockSpannerServiceImpl.StatementResult;
2727
import com.google.cloud.spanner.connection.AbstractMockServerTest;
2828
import com.google.cloud.spanner.connection.SpannerPool;
29+
import com.google.spanner.v1.BatchCreateSessionsRequest;
2930
import com.google.spanner.v1.CreateSessionRequest;
3031
import com.google.spanner.v1.ExecuteSqlRequest;
3132
import com.google.spanner.v1.Session;
@@ -188,8 +189,6 @@ public void testUsesRegularSessionForQueryInTransaction() throws SQLException {
188189
public void testUsesMultiplexedSessionInCombinationWithSessionPoolOptions() throws SQLException {
189190
// Create a connection that uses a session pool with MinSessions=0.
190191
// This should stop any regular sessions from being created.
191-
// TODO: Modify this test once https://github.com/googleapis/java-spanner/pull/3197 has been
192-
// released.
193192
try (Connection connection = DriverManager.getConnection(createUrl() + ";minSessions=0")) {
194193
assertTrue(connection.getAutoCommit());
195194
try (ResultSet resultSet = connection.createStatement().executeQuery(SELECT_RANDOM_SQL)) {
@@ -199,19 +198,14 @@ public void testUsesMultiplexedSessionInCombinationWithSessionPoolOptions() thro
199198
}
200199
}
201200
}
202-
// TODO: Remove this line once https://github.com/googleapis/java-spanner/pull/3197 has been
203-
// released.
204-
// Adding 'minSessions=X' or 'maxSessions=x' to the connection URL currently disables the use of
205-
// multiplexed sessions due to a bug in the Spanner Java client.
206-
assertEquals(0, mockSpanner.countRequestsOfType(CreateSessionRequest.class));
207201

208202
// Verify that one multiplexed session was created and used.
209-
// TODO: Uncomment
210-
// assertEquals(1, mockSpanner.countRequestsOfType(CreateSessionRequest.class));
211-
// CreateSessionRequest request =
212-
// mockSpanner.getRequestsOfType(CreateSessionRequest.class).get(0);
213-
// assertTrue(request.getSession().getMultiplexed());
214-
// // There should be no regular sessions in use.
215-
// assertEquals(0, mockSpanner.countRequestsOfType(BatchCreateSessionsRequest.class));
203+
assertEquals(1, mockSpanner.countRequestsOfType(CreateSessionRequest.class));
204+
CreateSessionRequest request = mockSpanner.getRequestsOfType(CreateSessionRequest.class).get(0);
205+
assertTrue(request.getSession().getMultiplexed());
206+
// There should be no regular sessions in use.
207+
// However, the query that detects the dialect that is used, uses a regular session.
208+
// This should be fixed in the Java client.
209+
assertEquals(1, mockSpanner.countRequestsOfType(BatchCreateSessionsRequest.class));
216210
}
217211
}

0 commit comments

Comments
 (0)