code: def test_return_code_on_worker_error(self) -> None:
      with ipc.PIDServer(addr=0, num_clients=2) as pid_server:
          assert pid_server.listener
          _, port = pid_server.listener.getsockname()
  
          # Enforce that the crashed worker causes the exit before the other worker exits.
          deadline = time.time() + 20
  
          # Enforce that run_subprocess exits nonzero on a worker failure, even if the main
          # subprocess exits zero.
          procs = [
              multiprocessing.Process(
                  target=TestPIDServer._worker_proc,
                  args=(port, False, 30),
              ),
              multiprocessing.Process(
                  target=TestPIDServer._worker_proc,
                  args=(port, False, 0.5, 1, True),
              ),
          ]
  
          for p in procs:
              p.start()
  
          error_code = pid_server.run_subprocess(["sleep", "2"])
  
          assert error_code == 79
  
          assert (
              time.time() < deadline
          ), "crashing worker did not trigger exit"
  
          for p in procs:
              p.terminate()
              p.join()
  
imports: import abc
  import itertools
  import multiprocessing
  import sys
  import textwrap
  import time
  import traceback
  from typing import Any, List, Optional, cast
  import pytest
  import determined
  from determined import core, ipc
  from tests import parallel
label_desc: Use image node_id 4 for calling the TestPIDServer obj's underlying member method code with example usage: obj.test_return_code_on_worker_error() without return types