code: def _test_master_restart_kill_works(
      managed_cluster_restarts: Cluster,
  ) -> None:
      try:
          exp_id = exp.create_experiment(
              conf.fixtures_path("no_op/single-many-long-steps.yaml"),
              conf.fixtures_path("no_op"),
              [
                  "--config",
                  "searcher.max_length.batches=10000",
                  "--config",
                  "max_restarts=0",
              ],
          )
  
          exp.wait_for_experiment_workload_progress(exp_id)
  
          managed_cluster_restarts.kill_master()
          time.sleep(0)
          managed_cluster_restarts.restart_master()
  
          command = [
              "det",
              "-m",
              conf.make_master_url(),
              "e",
              "kill",
              str(exp_id),
          ]
          subprocess.check_call(command)
  
          exp.wait_for_experiment_state(
              exp_id, EXP_STATE.CANCELED, max_wait_secs=30
          )
  
          managed_cluster_restarts.ensure_agent_ok()
      except Exception:
          managed_cluster_restarts.restart_master()
          managed_cluster_restarts.restart_agent()
  
imports: import logging
  import subprocess
  import time
  import docker
  import pytest
  import requests
  from determined.common import constants
  from determined.common.api import authentication, task_is_ready, task_logs
  from determined.common.api.bindings import experimentv1State
  from tests import api_utils
  from tests import command
  from tests import config
  from tests import experiment
  from tests.cluster.test_users import det_spawn
  from .abstract_cluster import Cluster
  from .managed_cluster import ManagedCluster, get_agent_data
  from .managed_cluster_k8s import ManagedK8sCluster
  from .test_groups import det_cmd, det_cmd_json
  from .utils import assert_command_succeeded, run_command, wait_for_command_state, wait_for_task_state
label_desc: Use image node_id 11 for calling a global function with example usage: _test_master_restart_kill_works(managed_cluster_restarts) without return types