Skip to content

Commit

Permalink
[Test] Use stream.next instead of setAutoRead in test
Browse files Browse the repository at this point in the history
For a more realistic simulation.
  • Loading branch information
ywangd committed Oct 18, 2024
1 parent 5bf446e commit d7a3be1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,11 @@ public void testClientConnectionCloseMidStream() throws Exception {
var handler = ctx.awaitRestChannelAccepted(opaqueId);
assertBusy(() -> assertNotNull(handler.stream.buf()));

// enable auto-read to receive channel close event
handler.stream.channel().config().setAutoRead(true);
assertFalse(handler.streamClosed);

handler.stream.next(); // read the first half of the request
handler.stream.next(); // attempt to read more data and it should notice channel being closed eventually

// terminate connection and wait resources are released
ctx.clientChannel.close();
assertBusy(() -> {
Expand Down

0 comments on commit d7a3be1

Please sign in to comment.