code: def test_repeat(setup):
      state_file, test_script = setup
  
      assert (
          _run_script(
              test_script,
              state_file,
              ExitCode.SUCCESS,
              ExitCode.SUCCESS,
              ExitCode.SUCCESS,
          )
          == ExitCode.SUCCESS.value
      )
      assert _read_state(state_file) == 1
  
      assert (
          _run_script(
              test_script,
              state_file,
              ExitCode.RAY_WHEELS_TIMEOUT,
              ExitCode.SUCCESS,
              ExitCode.SUCCESS,
          )
          == ExitCode.SUCCESS.value
      )
      assert _read_state(state_file) == 2
  
      assert (
          _run_script(
              test_script,
              state_file,
              ExitCode.RAY_WHEELS_TIMEOUT,
              ExitCode.CLUSTER_ENV_BUILD_TIMEOUT,
              ExitCode.SUCCESS,
          )
          == ExitCode.SUCCESS.value
      )
      assert _read_state(state_file) == 3
  
      assert (
          _run_script(
              test_script,
              state_file,
              ExitCode.CLUSTER_STARTUP_TIMEOUT,
              ExitCode.CLUSTER_WAIT_TIMEOUT,
              ExitCode.RAY_WHEELS_TIMEOUT,
          )
          == 79  # BUILDKITE_RETRY_CODE
      )
      assert _read_state(state_file) == 3
  
      assert (
          _run_script(
              test_script,
              state_file,
              ExitCode.RAY_WHEELS_TIMEOUT,
              ExitCode.COMMAND_ALERT,
              ExitCode.SUCCESS,
          )
          == 79  # BUILDKITE_RETRY_CODE
      )
      assert _read_state(state_file) == 2
  
file_path: ray/release/ray_release/tests/test_run_script.py
imports: import json
  import os
  import subprocess
  import sys
  import tempfile
  import pytest
  from ray_release.result import ExitCode
label_desc: Use image node_id 4 for calling a global function with example usage: test_repeat(setup) without return types