def METHOD_NAME(
        mocker, flow_or_deployment, protocol, port_generator
):
    if flow_or_deployment == 'deployment' and protocol in ['websocket', 'http']:
        return
    random_port = port_generator()
    client = Client(host=f'{protocol}://localhost:{random_port}')
    stop_event = multiprocessing.Event()
    start_event = multiprocessing.Event()
    t = multiprocessing.Process(target=_start_runtime,
                                args=(protocol, random_port, flow_or_deployment, stop_event, start_event))
    t.start()
    start_event.wait(5)
    try:
        # Test that a regular index request triggers the correct callbacks
        on_error_mock = mocker.Mock()
        response = _random_post_request(client, on_error_mock, use_stream=False)
        assert len(response) == 1
        on_error_mock.assert_not_called()
    finally:
        stop_event.set()
        t.join(5)
        t.terminate()