code: def _check_crash(self, error, func, *args, ignore_stderr=False):
      # test for deadlock caused by crashes in a pool
      self.executor.shutdown(wait=True)
  
      executor = self.executor_type(
          max_workers=2, mp_context=self.get_context()
      )
      res = executor.submit(func, *args)
  
      if ignore_stderr:
          cm = support.captured_stderr()
      else:
          cm = contextlib.nullcontext()
  
      try:
          with self.assertRaises(error):
              with cm:
                  res.result(timeout=self.TIMEOUT)
      except futures.TimeoutError:
          # If we did not recover before TIMEOUT seconds,
          # consider that the executor is in a deadlock state
          self._fail_on_deadlock(executor)
      executor.shutdown(wait=True)
  
imports: import contextlib
  import queue
  import signal
  import sys
  import time
  import unittest
  import unittest.mock
  from pickle import PicklingError
  from concurrent import futures
  from concurrent.futures.process import BrokenProcessPool, _ThreadWakeup
  from test import support
  from .util import create_executor_tests, setup_module, ProcessPoolForkMixin, ProcessPoolForkserverMixin, ProcessPoolSpawnMixin
label_desc: Use image node_id 2 for calling the ExecutorDeadlockTest obj's underlying member method code with example usage: obj._check_crash(error, func) without return types