Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ public void testStreamAckDeadlineIsSetCorrectly() throws Exception {
fakeSubscriberServiceImpl.getLastSeenRequest().getStreamAckDeadlineSeconds());

subscriber.stopAsync().awaitTerminated();
// awaitTerminated() only covers the client side. The fake server finds out asynchronously
// that the stream was closed, so wait for that before starting the next subscriber. Otherwise
// the old stream may still be counted, and its request returned, by the assertions below.
fakeSubscriberServiceImpl.waitForClosedStreams(1);

// Deadline is higher than the allowed streamAckDeadline.
maxDurationPerAckExtension = 700;
Expand All @@ -265,6 +269,7 @@ public void testStreamAckDeadlineIsSetCorrectly() throws Exception {
fakeSubscriberServiceImpl.getLastSeenRequest().getStreamAckDeadlineSeconds());

subscriber.stopAsync().awaitTerminated();
fakeSubscriberServiceImpl.waitForClosedStreams(2);

// Deadline is within the allowed limits for streamAckDeadline.
maxDurationPerAckExtension = 100;
Expand All @@ -280,6 +285,7 @@ public void testStreamAckDeadlineIsSetCorrectly() throws Exception {
fakeSubscriberServiceImpl.getLastSeenRequest().getStreamAckDeadlineSeconds());

subscriber.stopAsync().awaitTerminated();
fakeSubscriberServiceImpl.waitForClosedStreams(3);

// maxDurationPerAckExtension is unset.
subscriber = startSubscriber(getTestSubscriberBuilder(testReceiver));
Expand Down
Loading