Skip to content

Commit 9108ee4

Browse files
authored
test: unflake SavepointMockServerTest (#3694)
1 parent 1f285e3 commit 9108ee4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SavepointMockServerTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public void clearRequests() {
9090
mockSpanner.clearRequests();
9191
}
9292

93+
@SuppressWarnings("ClassEscapesDefinedScope")
9394
@Override
9495
public ITConnection createConnection() {
9596
return createConnection(
@@ -698,9 +699,10 @@ public void testKeepAlive() throws InterruptedException, TimeoutException {
698699
connection.savepoint("s1");
699700
connection.execute(INSERT_STATEMENT);
700701
connection.rollbackToSavepoint("s1");
701-
mockSpanner.waitForRequestsToContain(RollbackRequest.class, 1000L);
702702
String keepAliveTagAfterRollback = "test_keep_alive_tag_after_rollback";
703703
System.setProperty("spanner.connection.keep_alive_query_tag", keepAliveTagAfterRollback);
704+
mockSpanner.waitForRequestsToContain(RollbackRequest.class, 1000L);
705+
mockSpanner.clearRequests();
704706

705707
// Verify that we don't get any new keep-alive requests from this point.
706708
Thread.sleep(2L);

0 commit comments

Comments
 (0)