Skip to content

Commit 4fd6705

Browse files
committed
fix race in FakeSubscriberServiceImpl
This is the same race as #1495 but in sendStreamResponse rather than sendError.
1 parent d325afb commit 4fd6705

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/FakeSubscriberServiceImpl.java

+1
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ public void sendStreamingResponse(StreamingPullResponse pullResponse)
208208
throws InterruptedException {
209209
waitForRegistedSubscription();
210210
synchronized (openedStreams) {
211+
waitForOpenedStreams(1);
211212
openedStreams.get(getAndAdvanceCurrentStream()).responseObserver.onNext(pullResponse);
212213
}
213214
}

0 commit comments

Comments
 (0)