code: def main():
      result = {
          TestScenario.KILL_WORKER_NODE.value: {"rate": None},
          TestScenario.KILL_HEAD_NODE.value: {"rate": None},
      }
      expected_result = {
          TestScenario.KILL_HEAD_NODE: 0.99,
          TestScenario.KILL_HEAD_NODE: 0.99,
      }
      check_kuberay_installed()
      users = 60
      exception = None
      for kill_node_type, kill_interval, test_duration in [
          (TestScenario.KILL_WORKER_NODE, 60, 600),
          (TestScenario.KILL_HEAD_NODE, 300, 1200),
      ]:
          try:
              generate_cluster_variable()
              procs = []
              start_rayservice()
              procs.append(start_port_forward())
              warmup_cluster(200)
              procs.append(
                  start_sending_traffics(test_duration * 1.1, users)
              )
              start_killing_nodes(
                  test_duration, kill_interval, kill_node_type
              )
              rate, qps, data = get_stats()
              print("Raw Data", data, qps)
              result[kill_node_type.value]["rate"] = rate
              assert expected_result[kill_node_type] <= rate
              assert qps > users * 10 * 0.8
          except Exception as e:
              print(f"{kill_node_type} HA test failed, {e}")
              exception = e
          finally:
              print("=== Cleanup ===")
              subprocess.run(
                  ["kubectl", "delete", "-f", str(yaml_path)],
                  capture_output=True,
              )
              subprocess.run(
                  ["helm", "uninstall", LOCUST_ID],
                  capture_output=True,
              )
              for p in procs:
                  p.kill()
              print("==== Cleanup done ===")
  
          if exception:
              raise exception
  
          print("Result:", result)
  
          test_output_json_path = os.environ.get(
              "TEST_OUTPUT_JSON", "/tmp/release_test_output.json"
          )
          with open(test_output_json_path, "wt") as f:
              json.dump(result, f)
  
imports: import enum
  import json
  import subprocess
  from kubernetes import client, config, watch
  import requests
  import random
  import uuid
  import pathlib
  import time
  import ray
  import os
label_desc: Use image node_id 12 for calling a global function with example usage: main() without return types