@Test
public void simpleOnDiscardRequestChannelTest2() {

  ByteBufAllocator allocator = rule.alloc();
  AssertSubscriber<Payload> assertSubscriber = AssertSubscriber.create(1);
  TestPublisher<Payload> testPublisher = TestPublisher.create();
  Flux<Payload> payloadFlux = rule.socket.requestChannel(testPublisher);
  payloadFlux.subscribe(assertSubscriber);
  testPublisher.next(ByteBufPayload.create("d", "m"));
  int streamId = rule.getStreamIdForRequestType(REQUEST_CHANNEL);
  testPublisher.next(ByteBufPayload.create("d1", "m1"), ByteBufPayload.create("d2", "m2"));
  rule.connection.addToReceivedBuffer(
      ErrorFrameCodec.encode(
          allocator, streamId, new CustomRSocketException(0x00000404, "test")));
  Assertions.assertThat(rule.connection.getSent()).allMatch(ByteBuf::release);
  rule.assertHasNoLeaks();
}