Skip to content

Commit

Permalink
test: unflake RetryOnInvalidatedSessionTest (#3561)
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite authored Dec 16, 2024
1 parent 557b214 commit 430143c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public static void stopServer() throws InterruptedException {
public void setUp() throws InterruptedException {
mockSpanner.reset();
if (spanner == null
|| spanner.getOptions().getSessionPoolOptions().isFailIfPoolExhausted()
|| spanner.getOptions().getSessionPoolOptions().isFailIfSessionNotFound()
!= failOnInvalidatedSession) {
if (spanner != null) {
spanner.close();
Expand All @@ -228,8 +228,8 @@ public void setUp() throws InterruptedException {
.build()
.getService();
client = spanner.getDatabaseClient(DatabaseId.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"));
invalidateSessionPool(client, spanner.getOptions().getSessionPoolOptions().getMinSessions());
}
invalidateSessionPool(client, spanner.getOptions().getSessionPoolOptions().getMinSessions());
}

private static void invalidateSessionPool(DatabaseClient client, int minSessions)
Expand Down Expand Up @@ -1002,6 +1002,7 @@ public void transactionManagerBatchUpdate() throws InterruptedException {
} catch (AbortedException e) {
transaction = assertThrowsSessionNotFoundIfShouldFail(() -> manager.resetForRetry());
if (transaction == null) {
manager.close();
break;
}
}
Expand Down

0 comments on commit 430143c

Please sign in to comment.