Skip to content

Commit

Permalink
tests: benchmark should start the transaction (#150)
Browse files Browse the repository at this point in the history
The steadyIncrease benchmark only checked out a read-only session from
the pool, but did not actually start the transaction. That is only done
once a statement is issued for the transaction.

Note that issuing the statement does not actually execute the
statement. That is deferred to the first call to ResultSet#next().
  • Loading branch information
olavloite committed Apr 20, 2020
1 parent 66b10ac commit d4c4387
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -379,7 +379,9 @@ public void steadyIncrease(MockServer server) throws Exception {
// Checkout maxSessions sessions by starting maxSessions read-only transactions sequentially.
List<ReadOnlyTransaction> transactions = new ArrayList<>(server.maxSessions);
for (int i = 0; i < server.maxSessions; i++) {
transactions.add(client.readOnlyTransaction());
ReadOnlyTransaction tx = client.readOnlyTransaction();
tx.executeQuery(MockServer.SELECT1);
transactions.add(tx);
}
for (ReadOnlyTransaction tx : transactions) {
tx.close();
Expand Down

0 comments on commit d4c4387

Please sign in to comment.