From fc29cd35101fd6a6262aea8648bc06bd20ce3d10 Mon Sep 17 00:00:00 2001 From: Igor Bernstein Date: Thu, 16 Feb 2023 11:06:07 -0500 Subject: [PATCH] fix(test): fix flaky test (#1633) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(test): fix flaky test The expectation list needs to be thread safe as it could be accessed from multiple grpc server threads Change-Id: I74be5cd433fc31963b1c22091216dffa1ef9c55e * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * missing import Change-Id: Ide19ef7ba2f29b1bb9d3fc211d652567c53fdbfb --------- Co-authored-by: Owl Bot --- .../bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java index 0f9ad21fa0..8a8c6d7709 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java @@ -34,7 +34,6 @@ import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; import com.google.cloud.bigtable.data.v2.models.Row; import com.google.common.collect.Lists; -import com.google.common.collect.Queues; import com.google.common.collect.Range; import com.google.common.truth.Truth; import com.google.protobuf.ByteString; @@ -48,6 +47,7 @@ import java.io.IOException; import java.util.List; import java.util.Queue; +import java.util.concurrent.LinkedBlockingDeque; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -300,7 +300,7 @@ private List getResults(Query query) { } private static class TestBigtableService extends BigtableGrpc.BigtableImplBase { - Queue expectations = Queues.newArrayDeque(); + Queue expectations = new LinkedBlockingDeque<>(); int i = -1; @Override