def METHOD_NAME():
    with safe_tempfile_path() as skt:
        with pytest.raises(
            check.CheckError,
            match=re.escape("You must pass one and only one of `port` or `socket`."),
        ):
            DagsterGrpcServer(
                server_termination_event=threading.Event(),
                dagster_api_servicer=mock.MagicMock(),
                logger=logging.getLogger("dagster.code_server"),
                socket=skt,
                port=find_free_port(),
            )