From 20fe91d61a2fdbcc4f359935dbecec9e892be0ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Wed, 7 Aug 2024 15:53:50 +0200 Subject: [PATCH] chore: unflake asyncTransactionManagerWaitsUntilAsyncBatchUpdateHasFinished Fixes #3241 --- .../spanner/AsyncTransactionManagerTest.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AsyncTransactionManagerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AsyncTransactionManagerTest.java index 7318e6e2c31..863c731c19c 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AsyncTransactionManagerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AsyncTransactionManagerTest.java @@ -46,6 +46,7 @@ import com.google.common.collect.Range; import com.google.common.util.concurrent.MoreExecutors; import com.google.protobuf.AbstractMessage; +import com.google.protobuf.GeneratedMessageV3; import com.google.spanner.v1.BatchCreateSessionsRequest; import com.google.spanner.v1.BeginTransactionRequest; import com.google.spanner.v1.CommitRequest; @@ -983,17 +984,13 @@ public void asyncTransactionManagerWaitsUntilAsyncBatchUpdateHasFinished() throw } } } + ImmutableList> expectedRequests = + ImmutableList.of( + BatchCreateSessionsRequest.class, ExecuteBatchDmlRequest.class, CommitRequest.class); if (isMultiplexedSessionsEnabled()) { - assertThat(mockSpanner.getRequestTypes()) - .containsExactly( - CreateSessionRequest.class, - BatchCreateSessionsRequest.class, - ExecuteBatchDmlRequest.class, - CommitRequest.class); + assertThat(mockSpanner.getRequestTypes()).containsAtLeastElementsIn(expectedRequests); } else { - assertThat(mockSpanner.getRequestTypes()) - .containsExactly( - BatchCreateSessionsRequest.class, ExecuteBatchDmlRequest.class, CommitRequest.class); + assertThat(mockSpanner.getRequestTypes()).containsExactlyElementsIn(expectedRequests); } }