code: def test_migration_checkpoint_removal(
      start_connected_emptyhead_cluster, tmpdir, storage
  ):
      """Test checks that trial restarts if checkpoint is lost w/ node fail."""
      cluster = start_connected_emptyhead_cluster
      node = cluster.add_node(num_cpus=1)
      cluster.wait_for_nodes()
  
      runner = TuneController(
          search_alg=BasicVariantGenerator(), storage=storage
      )
      kwargs = {
          "stopping_criterion": {"training_iteration": 4},
          "checkpoint_config": CheckpointConfig(checkpoint_frequency=2),
          "max_failures": 2,
          "storage": storage,
      }
  
      # Test recovery of trial that has been checkpointed
      t1 = Trial("__fake", **kwargs)
      runner.add_trial(t1)
  
      # Start trial, process result (x2), process save
      while not t1.has_checkpoint():
          runner.step()
  
      cluster.add_node(num_cpus=1)
      cluster.remove_node(node)
      cluster.wait_for_nodes()
  
      while not runner.is_finished():
          runner.step()
      assert t1.status == Trial.TERMINATED
  
imports: import time
  import os
  import pytest
  import sys
  from unittest.mock import MagicMock
  import ray
  from ray import tune
  from ray.train import CheckpointConfig
  from ray.cluster_utils import Cluster
  from ray.train._internal.storage import StorageContext
  from ray.tune.error import TuneError
  from ray.tune.search import BasicVariantGenerator
  from ray.tune.experiment import Trial
  from ray.tune.execution.tune_controller import TuneController
label_desc: Use image node_id 11 for calling a global function with example usage: test_migration_checkpoint_removal(start_connected_emptyhead_cluster, tmpdir, storage) without return types