docstr: Tests that ActorPoolMapOperator raises an exception on
  timeout while waiting for actors.
docstr_tok: ["Tests","that","ActorPoolMapOperator","raises","an","exception","on","timeout","while","waiting","for","actors","."]
code: def test_start_actor_timeout(ray_start_regular_shared):
      """Tests that ActorPoolMapOperator raises an exception on
      timeout while waiting for actors."""
  
      class UDFClass:
          def __call__(self, x):
              return x
  
      from ray.data._internal.execution.operators import (
          actor_pool_map_operator,
      )
      from ray.exceptions import GetTimeoutError
  
      original_timeout = (
          actor_pool_map_operator.DEFAULT_WAIT_FOR_MIN_ACTORS_SEC
      )
      actor_pool_map_operator.DEFAULT_WAIT_FOR_MIN_ACTORS_SEC = 1
  
      with pytest.raises(
          GetTimeoutError,
          match=(
              "Timed out while starting actors. This may mean that the cluster "
              "does not have enough resources for the requested actor pool."
          ),
      ):
          # Specify an unachievable resource requirement to ensure
          # we timeout while waiting for actors.
          ray.data.range(10).map_batches(
              UDFClass,
              batch_size=1,
              compute=ray.data.ActorPoolStrategy(size=5),
              num_gpus=100,
          ).take_all()
      actor_pool_map_operator.DEFAULT_WAIT_FOR_MIN_ACTORS_SEC = (
          original_timeout
      )
  
imports: import collections
  import time
  import pytest
  import ray
  from ray.data._internal.compute import ActorPoolStrategy
  from ray.data._internal.execution.operators.actor_pool_map_operator import AutoscalingConfig, AutoscalingPolicy, _ActorPool
  from ray.data._internal.execution.util import make_ref_bundles
  from ray.tests.conftest import *
label_desc: Use image node_id 8 for calling the TestAutoscalingPolicy obj's underlying member method code with example usage: obj.test_start_actor_timeout(ray_start_regular_shared) and returns: x