code: def test_kill_process_slow_patiently():
      process = subprocess.Popen(
          [sys.executable, __file__, "--mode", "kill_slow"]
      )
      time.sleep(
          1
      )  # wait 1 second for the process to launch and register hooks
      start_time = time.time()
      kill_command(process.pid, timeout=3)  # wait long enough
      end_time = time.time()
      assert end_time - start_time < 5
  
file_path: nni/test/ut/tools/nnictl/test_kill_command.py
imports: import argparse
  import multiprocessing
  import os
  import subprocess
  import signal
  import sys
  import signal
  import time
  import pytest
  from nni.tools.nnictl.command_utils import kill_command, _check_pid_running
label_desc: Use image node_id 6 for calling a global function with example usage: test_kill_process_slow_patiently() without return types