Fixes #7209 - Flaky test GoAwayTest.testServerGoAwayWithStalledStreamServerConsumesDataOfInFlightStream()
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
4723d02d3d
commit
0fb733f32a
|
@ -44,6 +44,7 @@ import org.eclipse.jetty.http2.frames.DataFrame;
|
||||||
import org.eclipse.jetty.http2.frames.GoAwayFrame;
|
import org.eclipse.jetty.http2.frames.GoAwayFrame;
|
||||||
import org.eclipse.jetty.http2.frames.HeadersFrame;
|
import org.eclipse.jetty.http2.frames.HeadersFrame;
|
||||||
import org.eclipse.jetty.http2.frames.ResetFrame;
|
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.BufferUtil;
|
||||||
import org.eclipse.jetty.util.Callback;
|
import org.eclipse.jetty.util.Callback;
|
||||||
import org.eclipse.jetty.util.FuturePromise;
|
import org.eclipse.jetty.util.FuturePromise;
|
||||||
|
@ -423,10 +424,17 @@ public class GoAwayTest extends AbstractTest
|
||||||
h2.setInitialStreamRecvWindow(flowControlWindow);
|
h2.setInitialStreamRecvWindow(flowControlWindow);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
CountDownLatch clientSettingsLatch = new CountDownLatch(1);
|
||||||
CountDownLatch clientGoAwayLatch = new CountDownLatch(1);
|
CountDownLatch clientGoAwayLatch = new CountDownLatch(1);
|
||||||
CountDownLatch clientCloseLatch = new CountDownLatch(1);
|
CountDownLatch clientCloseLatch = new CountDownLatch(1);
|
||||||
Session clientSession = newClient(new Session.Listener.Adapter()
|
Session clientSession = newClient(new Session.Listener.Adapter()
|
||||||
{
|
{
|
||||||
|
@Override
|
||||||
|
public void onSettings(Session session, SettingsFrame frame)
|
||||||
|
{
|
||||||
|
clientSettingsLatch.countDown();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGoAway(Session session, GoAwayFrame frame)
|
public void onGoAway(Session session, GoAwayFrame frame)
|
||||||
{
|
{
|
||||||
|
@ -439,6 +447,12 @@ public class GoAwayTest extends AbstractTest
|
||||||
clientCloseLatch.countDown();
|
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
|
// 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.
|
// default and the server cannot send a WINDOW_UPDATE with a negative value.
|
||||||
((ISession)clientSession).updateSendWindow(flowControlWindow - FlowControlStrategy.DEFAULT_WINDOW_SIZE);
|
((ISession)clientSession).updateSendWindow(flowControlWindow - FlowControlStrategy.DEFAULT_WINDOW_SIZE);
|
||||||
|
|
Loading…
Reference in New Issue