|
13 | 13 |
|
14 | 14 | import io.netty.bootstrap.Bootstrap; |
15 | 15 | import io.netty.buffer.ByteBuf; |
16 | | -import io.netty.channel.Channel; |
17 | | -import io.netty.channel.ChannelFuture; |
18 | | -import io.netty.channel.ChannelHandlerContext; |
19 | | -import io.netty.channel.ChannelInitializer; |
| 16 | +import io.netty.channel.*; |
20 | 17 | import io.netty.channel.nio.NioEventLoopGroup; |
21 | 18 | import io.netty.channel.socket.nio.NioSocketChannel; |
22 | 19 | import io.netty.handler.codec.http2.AbstractHttp2ConnectionHandlerBuilder; |
@@ -62,6 +59,7 @@ public void testMYR() throws Exception { |
62 | 59 | testMYR(false); |
63 | 60 | } |
64 | 61 |
|
| 62 | + @Repeat(times = 1000) |
65 | 63 | @Test |
66 | 64 | public void testMYRMultiplex() throws Exception { |
67 | 65 | testMYR(true); |
@@ -164,6 +162,33 @@ public void onGoAwayRead(ChannelHandlerContext ctx, int lastStreamId, long error |
164 | 162 | Builder clientHandlerBuilder = new Builder(); |
165 | 163 | Http2ConnectionHandler clientHandler = clientHandlerBuilder.build(); |
166 | 164 | ch.pipeline().addLast(clientHandler); |
| 165 | + ch.pipeline().addLast(new ChannelDuplexHandler() { |
| 166 | + @Override |
| 167 | + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { |
| 168 | + System.out.println("GOT IT!!!!!"); |
| 169 | + System.out.println("GOT IT!!!!!"); |
| 170 | + System.out.println("GOT IT!!!!!"); |
| 171 | + System.out.println("GOT IT!!!!!"); |
| 172 | + System.out.println("GOT IT!!!!!"); |
| 173 | + System.out.println("GOT IT!!!!!"); |
| 174 | + System.out.println("GOT IT!!!!!"); |
| 175 | + System.out.println("GOT IT!!!!!"); |
| 176 | + System.out.println("GOT IT!!!!!"); |
| 177 | + System.out.println("GOT IT!!!!!"); |
| 178 | + System.out.println("GOT IT!!!!!"); |
| 179 | + System.out.println("GOT IT!!!!!"); |
| 180 | + System.out.println("GOT IT!!!!!"); |
| 181 | + System.out.println("GOT IT!!!!!"); |
| 182 | + System.out.println("GOT IT!!!!!"); |
| 183 | + System.out.println("GOT IT!!!!!"); |
| 184 | + System.out.println("GOT IT!!!!!"); |
| 185 | + System.out.println("GOT IT!!!!!"); |
| 186 | + System.out.println("GOT IT!!!!!"); |
| 187 | + System.out.println("GOT IT!!!!!"); |
| 188 | + System.out.println("GOT IT!!!!!"); |
| 189 | + System.out.println("GOT IT!!!!!"); |
| 190 | + } |
| 191 | + }); |
167 | 192 | } |
168 | 193 | }; |
169 | 194 | } |
@@ -192,7 +217,7 @@ public ChannelFuture connect(int port, String host, BiConsumer<ChannelHandlerCon |
192 | 217 | chctx.flush(); |
193 | 218 | }).sync(); |
194 | 219 |
|
195 | | - goAway.get(10, TimeUnit.SECONDS); |
| 220 | + goAway.get(20, TimeUnit.SECONDS); |
196 | 221 |
|
197 | 222 | // Check the number of rst frame received before getting a go away |
198 | 223 | assertEquals(receivedRstFrames.get(), maxRstFramePerWindow + 1); |
|
0 commit comments