Skip to content

Commit

Permalink
Fixed test FlowControlStrategyTest after the changes of #10554.
Browse files Browse the repository at this point in the history
Signed-off-by: Simone Bordet <[email protected]>
  • Loading branch information
sbordet committed Oct 5, 2023
1 parent a4b55e6 commit ff57574
Showing 1 changed file with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,6 @@ public void onDataAvailable(Stream stream)
public void testClientExceedingSessionWindow(FlowControlStrategyType type) throws Exception
{
// On server, we don't consume the data.
List<Stream.Data> dataList = new ArrayList<>();
CountDownLatch serverCloseLatch = new CountDownLatch(1);
start(type, new ServerSessionListener()
{
Expand All @@ -735,11 +734,7 @@ public Stream.Listener onNewStream(Stream stream, HeadersFrame frame)
@Override
public void onDataAvailable(Stream stream)
{
// Read but do not release the Data.
Stream.Data data = stream.readData();
if (!data.frame().isEndStream())
stream.demand();
dataList.add(data);
// Do not read to stall the flow control.
}
};
}
Expand Down Expand Up @@ -816,16 +811,13 @@ public void succeeded()
assertTrue(clientGoAwayLatch.await(5, TimeUnit.SECONDS));
assertTrue(clientCloseLatch.await(5, TimeUnit.SECONDS));
assertTrue(serverCloseLatch.await(5, TimeUnit.SECONDS));

dataList.forEach(Stream.Data::release);
}

@ParameterizedTest
@EnumSource(FlowControlStrategyType.class)
public void testClientExceedingStreamWindow(FlowControlStrategyType type) throws Exception
{
// On server, we don't consume the data.
List<Stream.Data> dataList = new ArrayList<>();
CountDownLatch serverCloseLatch = new CountDownLatch(1);
start(type, new ServerSessionListener()
{
Expand All @@ -845,11 +837,7 @@ public Stream.Listener onNewStream(Stream stream, HeadersFrame frame)
@Override
public void onDataAvailable(Stream stream)
{
// Read but do not release the Data.
Stream.Data data = stream.readData();
if (!data.frame().isEndStream())
stream.demand();
dataList.add(data);
// Do not read to stall the flow control.
}
};
}
Expand Down Expand Up @@ -922,8 +910,6 @@ public void succeeded()
assertTrue(clientGoAwayLatch.await(5, TimeUnit.SECONDS));
assertTrue(clientCloseLatch.await(5, TimeUnit.SECONDS));
assertTrue(serverCloseLatch.await(5, TimeUnit.SECONDS));

dataList.forEach(Stream.Data::release);
}

@ParameterizedTest
Expand Down

0 comments on commit ff57574

Please sign in to comment.