Skip to content

Commit

Permalink
fix(test): fix flaky test (#1633)
Browse files Browse the repository at this point in the history
* 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 <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
igorbernstein2 and gcf-owl-bot[bot] authored Feb 16, 2023
1 parent a101494 commit fc29cd3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -300,7 +300,7 @@ private List<String> getResults(Query query) {
}

private static class TestBigtableService extends BigtableGrpc.BigtableImplBase {
Queue<RpcExpectation> expectations = Queues.newArrayDeque();
Queue<RpcExpectation> expectations = new LinkedBlockingDeque<>();
int i = -1;

@Override
Expand Down

0 comments on commit fc29cd3

Please sign in to comment.