Skip to content

Commit

Permalink
fix: sessions being prepared should be included in comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite committed Apr 21, 2020
1 parent f800dff commit 6ede807
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -1029,8 +1029,11 @@ public void run() {
verify(session, times(options.getMinSessions())).singleUse(any(TimestampBound.class));
// Verify that all sessions are still in the pool, and that the write fraction is maintained.
assertThat(pool.getNumberOfSessionsInPool()).isEqualTo(options.getMinSessions());
assertThat(pool.getNumberOfAvailableWritePreparedSessions())
.isEqualTo((int) Math.ceil(options.getMinSessions() * options.getWriteSessionsFraction()));
assertThat(
pool.getNumberOfAvailableWritePreparedSessions()
+ pool.getNumberOfSessionsBeingPrepared())
.isEqualTo(
(int) Math.ceil(pool.getNumberOfSessionsInPool() * options.getWriteSessionsFraction()));

// Check out MaxSessions sessions to add additional sessions to the pool.
List<Session> sessions = new ArrayList<>(options.getMaxSessions());
Expand Down

0 comments on commit 6ede807

Please sign in to comment.