code: def test_post_run_after_kill(test_queue):
      from celery import chain
  
      sig_bar = test_queue.proc.run_signature(
          ["python3", "-c", "import time; time.sleep(10)"], name="bar"
      )
      sig_bar.freeze()
      sig_foo = _foo.s()
      result_foo = sig_foo.freeze()
      run_chain = chain(sig_bar, sig_foo)
  
      run_chain.delay()
      timeout = time.time() + 10
  
      while True:
          try:
              test_queue.proc.kill("bar")
              assert result_foo.status == "PENDING"
              break
          except ProcessLookupError:
              time.sleep(0.1)
          if time.time() > timeout:
              raise TimeoutError
  
      assert result_foo.get(timeout=10) == "foo"
  
file_path: dvc/tests/unit/repo/experiments/queue/test_celery.py
imports: import time
  import pytest
  from celery import shared_task
  from celery.result import AsyncResult
  from dvc.exceptions import DvcException
  from dvc.repo.experiments.exceptions import UnresolvedExpNamesError
  from dvc.repo.experiments.queue.base import QueueDoneResult
  from dvc.repo.experiments.queue.exceptions import CannotKillTasksError
label_desc: Use image node_id 5 for calling a global function with example usage: test_post_run_after_kill(test_queue) without return types