diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java index aaceca5491..ae6f6d2442 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java @@ -39,6 +39,7 @@ import com.google.common.base.Stopwatch; import com.google.common.util.concurrent.MoreExecutors; import com.google.protobuf.ListValue; +import com.google.spanner.v1.DeleteSessionRequest; import com.google.spanner.v1.ResultSetMetadata; import com.google.spanner.v1.StructType; import com.google.spanner.v1.StructType.Field; @@ -269,6 +270,7 @@ private static void invalidateSessionPool(DatabaseClient client, int minSessions spannerClient.listSessions("projects/[PROJECT]/instances/[INSTANCE]/databases/[DATABASE]"); for (com.google.spanner.v1.Session session : response.iterateAll()) { spannerClient.deleteSession(session.getName()); + mockSpanner.doDeleteSession(session); } }