code: def test_env_installation_nonblocking(shutdown_only):
      """Test fix for https://github.com/ray-project/ray/issues/16226."""
      env1 = {"pip": ["pip-install-test==0.5"]}
  
      ray.init(runtime_env=env1)
  
      @ray.remote
      def f():
          return "hello"
  
      # Warm up a worker because it takes time to start.
      ray.get(f.remote())
  
      def assert_tasks_finish_quickly(total_sleep_s=0.1):
          """Call f every 0.01 seconds for total time total_sleep_s."""
          gap_s = 0.01
          for i in range(int(total_sleep_s / gap_s)):
              start = time.time()
              ray.get(f.remote())
              # Env installation takes around 10 to 60 seconds.  If we fail the
              # below assert, we can be pretty sure an env installation blocked
              # the task.
              assert time.time() - start < 2.0
              time.sleep(gap_s)
  
      assert_tasks_finish_quickly()
  
      env2 = {"pip": ["pip-install-test==0.5", "requests"]}
      f.options(runtime_env=env2).remote()
      # Check that installing env2 above does not block tasks using env1.
      assert_tasks_finish_quickly()
  
      proc = run_string_as_driver_nonblocking(
          install_env_script.format(env=env1)
      )
      # Check that installing env1 in a new worker in the script above does not
      # block other tasks that use env1.
      assert_tasks_finish_quickly(total_sleep_s=5)
      proc.kill()
      proc.wait()
  
imports: import os
  import platform
  from pathlib import Path
  import pytest
  import subprocess
  import sys
  import tempfile
  import time
  from typing import List
  from unittest import mock
  import yaml
  import ray
  from ray.runtime_env import RuntimeEnv
  from ray._private.runtime_env.conda import inject_dependencies, _inject_ray_to_conda_site, _resolve_install_from_source_ray_dependencies, _current_py_version
  from ray._private.runtime_env.conda_utils import get_conda_env_list
  from ray._private.test_utils import run_string_as_driver, run_string_as_driver_nonblocking, wait_for_condition, chdir
  from ray._private.utils import get_conda_env_dir, get_conda_bin_executable, try_to_create_directory
label_desc: Use image node_id 21 for calling a global function with example usage: test_env_installation_nonblocking(shutdown_only) and returns: str