docstr: Simulate failing to install a runtime_env in ray.init().
  
  By default eager_install is set to True.  We should make sure
  the driver fails to start if the eager_install fails.
docstr_tok: ["Simulate","failing","to","install","a","runtime_env","in","ray.init","(",")",".","By","default","eager_install","is","set","to","True",".","We","should","make","sure","the","driver","fails","to","start","if","the","eager_install","fails","."]
code: def test_eager_install_fail(
      self,
      tmpdir,
      monkeypatch,
      start_cluster,
      client_connection_timeout_1s,
  ):
      """Simulate failing to install a runtime_env in ray.init().
  
      By default eager_install is set to True.  We should make sure
      the driver fails to start if the eager_install fails.
      """
      _, address = start_cluster
  
      def init_ray():
          # Simulate failure using a nonexistent `pip` package.  This will pass
          # validation but fail during installation.
          ray.init(
              address, runtime_env={"pip": ["ray-nonexistent-pkg"]}
          )
  
      if using_ray_client(address):
          # Fails at ray.init() because the `pip` package is downloaded for the
          # Ray Client server.
          with pytest.raises(ConnectionAbortedError) as e:
              init_ray()
          assert (
              "No matching distribution found for ray-nonexistent-pkg"
              in str(e.value)
          )
      else:
          init_ray()
  
          # TODO(architkulkarni): After #25972 is resolved, we should raise an
          # exception in ray.init().  Until then, we need to `ray.get` a task
          # to raise the exception.
          @ray.remote
          def f():
              pass
  
          with pytest.raises(RuntimeEnvSetupError) as e:
              ray.get(f.remote())
          assert (
              "No matching distribution found for ray-nonexistent-pkg"
              in str(e.value)
          )
  
file_path: ray/python/ray/tests/test_runtime_env_failure.py
imports: import os
  from unittest import mock
  import pytest
  from ray._private.ray_constants import RAY_RUNTIME_ENV_URI_PIN_EXPIRATION_S_DEFAULT
  from ray._private.runtime_env.packaging import RAY_RUNTIME_ENV_FAIL_DOWNLOAD_FOR_TESTING_ENV_VAR, RAY_RUNTIME_ENV_FAIL_UPLOAD_FOR_TESTING_ENV_VAR
  import ray
  from ray.exceptions import RuntimeEnvSetupError
label_desc: Use image node_id 3 for calling the TestRuntimeEnvFailure obj's underlying member method code with example usage: obj.test_eager_install_fail(tmpdir, monkeypatch, start_cluster, client_connection_timeout_1s) without return types