@Test
@Timeout(2_000)
public void testRequestReplyWithCancel() {

  Mono<Payload> response = rule.socket.requestResponse(EmptyPayload.INSTANCE);
  try {
    response.block(Duration.ofMillis(100));
  } catch (IllegalStateException ise) {
  }
  List<ByteBuf> sent = new ArrayList<>(rule.connection.getSent());
  assertThat(
      "Unexpected frame sent on the connection.", frameType(sent.get(0)), is(REQUEST_RESPONSE));
  assertThat("Unexpected frame sent on the connection.", frameType(sent.get(1)), is(CANCEL));
  Assertions.assertThat(sent).hasSize(2).allMatch(ReferenceCounted::release);
  rule.assertHasNoLeaks();
}