def METHOD_NAME(unused_tcp_port):
    host = "localhost"
    url = f"ws://{host}:{unused_tcp_port}"
    reporter = Protobuf(experiment_url=url)
    job1 = Job({"name": "job1", "stdout": "stdout", "stderr": "stderr"}, 0)
    lines = []
    with _mock_ws_thread(host, unused_tcp_port, lines):
        reporter.report(
            Init(
                [job1],
                1,
                19,
                ens_id="ens_id",
                real_id=0,
                step_id=0,
                experiment_id="experiment_id",
            )
        )
        reporter.report(Exited(job1, 1).with_error("massive_failure"))
        reporter.report(Finish())
    assert len(lines) == 1
    event = DispatcherMessage()
    event.ParseFromString(lines[0])
    assert event.WhichOneof("object") == "job"
    # pylint: disable=no-member
    assert event.job.status == JOB_FAILURE
    assert event.job.error == "massive_failure"
    assert event.job.exit_code == 1