code: def test_invalid_trainable(
      ray_start_4_cpus_2_gpus_extra, resource_manager_cls
  ):
      """An invalid trainable should make the trial fail on startup.
  
      The controller itself should continue. Other trials should run.
  
      Legacy test: test_trial_runner_2.py::TrialRunnerTest::testErrorHandling
      """
      runner = TuneController(
          resource_manager_factory=lambda: resource_manager_cls(),
          storage=STORAGE,
      )
      kwargs = {
          "stopping_criterion": {"training_iteration": 1},
          "placement_group_factory": PlacementGroupFactory(
              [{"CPU": 1, "GPU": 1}]
          ),
          "storage": STORAGE,
      }
      _global_registry.register(TRAINABLE_CLASS, "asdf", None)
      trials = [Trial("asdf", **kwargs), Trial("__fake", **kwargs)]
      for t in trials:
          runner.add_trial(t)
  
      while not trials[1].status == Trial.RUNNING:
          runner.step()
      assert trials[0].status == Trial.ERROR
      assert trials[1].status == Trial.RUNNING
  
imports: import os
  from collections import Counter
  import pytest
  import sys
  import ray
  from ray.train import CheckpointConfig
  from ray.air.execution import FixedResourceManager, PlacementGroupResourceManager
  from ray.tune import PlacementGroupFactory, TuneError
  from ray.tune.execution.tune_controller import TuneController
  from ray.tune.experiment import Trial
  from ray.tune.registry import TRAINABLE_CLASS, _global_registry
  from ray.tune.schedulers import FIFOScheduler
  from ray.tune.search import BasicVariantGenerator
  from ray.train.tests.util import mock_storage_context
  from ray.tune.tests.execution.utils import BudgetResourceManager
label_desc: Use image node_id 3 for calling a global function with example usage: test_invalid_trainable(ray_start_4_cpus_2_gpus_extra, resource_manager_cls) without return types