Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: bump Spanner to 6.72.0 #1698

Merged
merged 1 commit into from
Aug 7, 2024
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner-bom</artifactId>
<version>6.71.0</version>
<version>6.72.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.google.cloud.spanner.jdbc;

import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import com.google.cloud.spanner.connection.AbstractMockServerTest;
Expand Down Expand Up @@ -103,7 +103,10 @@ public void testMaxSessions()
executor1.shutdown();
executor2.shutdown();
}
assertThat(mockSpanner.numSessionsCreated()).isEqualTo(1);
assertEquals(1, mockSpanner.countRequestsOfType(BatchCreateSessionsRequest.class));
BatchCreateSessionsRequest request =
mockSpanner.getRequestsOfType(BatchCreateSessionsRequest.class).get(0);
assertEquals(1, request.getSessionCount());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.google.cloud.spanner.MockSpannerServiceImpl.StatementResult;
import com.google.cloud.spanner.connection.AbstractMockServerTest;
import com.google.cloud.spanner.connection.SpannerPool;
import com.google.spanner.v1.BatchCreateSessionsRequest;
import com.google.spanner.v1.CreateSessionRequest;
import com.google.spanner.v1.ExecuteSqlRequest;
import com.google.spanner.v1.Session;
Expand Down Expand Up @@ -188,8 +189,6 @@ public void testUsesRegularSessionForQueryInTransaction() throws SQLException {
public void testUsesMultiplexedSessionInCombinationWithSessionPoolOptions() throws SQLException {
// Create a connection that uses a session pool with MinSessions=0.
// This should stop any regular sessions from being created.
// TODO: Modify this test once https://github.com/googleapis/java-spanner/pull/3197 has been
// released.
try (Connection connection = DriverManager.getConnection(createUrl() + ";minSessions=0")) {
assertTrue(connection.getAutoCommit());
try (ResultSet resultSet = connection.createStatement().executeQuery(SELECT_RANDOM_SQL)) {
Expand All @@ -199,19 +198,14 @@ public void testUsesMultiplexedSessionInCombinationWithSessionPoolOptions() thro
}
}
}
// TODO: Remove this line once https://github.com/googleapis/java-spanner/pull/3197 has been
// released.
// Adding 'minSessions=X' or 'maxSessions=x' to the connection URL currently disables the use of
// multiplexed sessions due to a bug in the Spanner Java client.
assertEquals(0, mockSpanner.countRequestsOfType(CreateSessionRequest.class));

// Verify that one multiplexed session was created and used.
// TODO: Uncomment
// assertEquals(1, mockSpanner.countRequestsOfType(CreateSessionRequest.class));
// CreateSessionRequest request =
// mockSpanner.getRequestsOfType(CreateSessionRequest.class).get(0);
// assertTrue(request.getSession().getMultiplexed());
// // There should be no regular sessions in use.
// assertEquals(0, mockSpanner.countRequestsOfType(BatchCreateSessionsRequest.class));
assertEquals(1, mockSpanner.countRequestsOfType(CreateSessionRequest.class));
CreateSessionRequest request = mockSpanner.getRequestsOfType(CreateSessionRequest.class).get(0);
assertTrue(request.getSession().getMultiplexed());
// There should be no regular sessions in use.
// However, the query that detects the dialect that is used, uses a regular session.
// This should be fixed in the Java client.
assertEquals(1, mockSpanner.countRequestsOfType(BatchCreateSessionsRequest.class));
}
}
Loading