Skip to content

Commit 502270c

Browse files
committed
chore(spanner): fix tests
1 parent 42ff2e5 commit 502270c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3093,14 +3093,15 @@ public void testDatabaseOrInstanceDoesNotExistOnCreate() {
30933093
.readWriteTransaction()
30943094
.run(transaction -> transaction.executeUpdate(UPDATE_STATEMENT)));
30953095
// No additional requests should have been sent by the client.
3096+
// Note that in case of the use of multiplexed sessions, then we have 2 requests:
30963097
// Note that in case of the use of regular sessions, then we have 1 request:
30973098
// 1. BatchCreateSessions for the session pool.
3098-
// Note that in case of the use of multiplexed sessions for read-only and read-write,
3099-
// then we have 1 request:
3100-
// 1. CreateSession for the multiplexed session.
3101-
// There will be no BatchCreateSessions request in case of multiplexed sessions, because
3102-
// the session pool options has min size of 0.
3103-
assertThat(mockSpanner.getRequests()).hasSize(2);
3099+
// 2. CreateSession for the multiplexed session.
3100+
assertThat(mockSpanner.getRequests())
3101+
.hasSize(
3102+
spanner.getOptions().getSessionPoolOptions().getUseMultiplexedSession()
3103+
? 2
3104+
: 1);
31043105
}
31053106
}
31063107
mockSpanner.reset();

0 commit comments

Comments
 (0)