mirror of
https://github.com/jetty/jetty.project.git
synced 2025-03-03 12:29:31 +00:00
Fixes #7209 - Flaky test GoAwayTest.testServerGoAwayWithStalledStreamServerConsumesDataOfInFlightStream()
Signed-off-by: Simone Bordet <simone.bordet@gmail.com> (cherry picked from commit 0fb733f32ad6b08ccceb5d5c0e01df2c95d44d37)
This commit is contained in:
parent
51123c7cd1
commit
0ac6718b35
@ -39,6 +39,7 @@ import org.eclipse.jetty.http2.frames.DataFrame;
|
||||
import org.eclipse.jetty.http2.frames.GoAwayFrame;
|
||||
import org.eclipse.jetty.http2.frames.HeadersFrame;
|
||||
import org.eclipse.jetty.http2.frames.ResetFrame;
|
||||
import org.eclipse.jetty.http2.frames.SettingsFrame;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.FuturePromise;
|
||||
@ -418,10 +419,17 @@ public class GoAwayTest extends AbstractTest
|
||||
h2.setInitialStreamRecvWindow(flowControlWindow);
|
||||
});
|
||||
|
||||
CountDownLatch clientSettingsLatch = new CountDownLatch(1);
|
||||
CountDownLatch clientGoAwayLatch = new CountDownLatch(1);
|
||||
CountDownLatch clientCloseLatch = new CountDownLatch(1);
|
||||
Session clientSession = newClient(new Session.Listener.Adapter()
|
||||
{
|
||||
@Override
|
||||
public void onSettings(Session session, SettingsFrame frame)
|
||||
{
|
||||
clientSettingsLatch.countDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGoAway(Session session, GoAwayFrame frame)
|
||||
{
|
||||
@ -434,6 +442,12 @@ public class GoAwayTest extends AbstractTest
|
||||
clientCloseLatch.countDown();
|
||||
}
|
||||
});
|
||||
|
||||
// Wait for the server settings to be received by the client.
|
||||
// In particular, we want to wait for the initial stream flow
|
||||
// control window setting before we create the first stream below.
|
||||
Assertions.assertTrue(clientSettingsLatch.await(5, TimeUnit.SECONDS));
|
||||
|
||||
// This is necessary because the server session window is smaller than the
|
||||
// default and the server cannot send a WINDOW_UPDATE with a negative value.
|
||||
((ISession)clientSession).updateSendWindow(flowControlWindow - FlowControlStrategy.DEFAULT_WINDOW_SIZE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user