def test_resetting_stream_with_frames_in_flight(self):
        self.set_up()

        recv_event = threading.Event()

        def socket_handler(listener):
            sock = listener.accept()[0]

            # We get two messages for the connection open and then a HEADERS
            # frame.
            receive_preamble(sock)
            sock.recv(65535)

            # Now, send the headers for the response. This response has no
            # body.
            f = build_headers_frame(
                [(':status', '204'), ('content-length', '0')]
            )
            f.flags.add('END_STREAM')
            f.stream_id = 1
            sock.send(f.serialize())

            # Wait for the message from the main thread.
            recv_event.wait(5)
            sock.close()

        self._start_server(socket_handler)
        conn = self.get_connection()
        stream_id = conn.request('GET', '/')

        # Now, trigger the RST_STREAM frame by closing the stream.
        conn._send_rst_frame(stream_id, 0)

        # Now, eat the Headers frame. This should not cause an exception.
        conn._recv_cb()

        # However, attempting to get the response should.
        with pytest.raises(StreamResetError):
            conn.get_response(stream_id)

        # Awesome, we're done now.
        recv_event.set()

        self.tear_down()
Hyper emits only one RST_STREAM frame, despite the other frames in
dataset/ETHPy150Open Lukasa/hyper/test/test_integration.py/TestHyperIntegration.test_resetting_stream_with_frames_in_flight