class_docstr: A suite of unit tests for ship_logs.py
  
  Yeah, it's a hack that these tests live in e2e tests.  But since they test python code it's
  just easier this way.
code: def test_escape_hatch(self) -> None:
      # Create a temporary directory to catch our escape-hatch logs
      tmp = tempfile.mkdtemp(suffix="ship_logs")
      try:
          with ShipLogServer() as srv:
              # Use a subprocess to control the environment.
              # Leave out DET_MASTER to force a crash.
              env = {"DET_SHIP_LOGS_PATH": tmp}
              cmd = mkcmd("pass")
              fullcmd = [sys.executable, "-u", ship_logs.__file__] + cmd
              p = subprocess.run(fullcmd, env=env)
              assert p.returncode == 80, p.returncode
              assert srv.logs == [], srv.logs
              files = os.listdir(tmp)
              assert len(files) == 2, files
              assert "ship-logs-ran" in files, files
              files.remove("ship-logs-ran")
              with open(os.path.join(tmp, files[0]), "r") as f:
                  text = f.read()
              assert "KeyError: 'DET_MASTER'" in text, text
      finally:
          shutil.rmtree(tmp)
  
imports: import io
  import json
  import logging
  import os
  import shutil
  import signal
  import socket
  import ssl
  import subprocess
  import sys
  import tempfile
  import textwrap
  import threading
  import time
  from typing import Any, List, Optional
  import pytest
label_desc: Use image node_id 14 for calling the TestShipLogs obj's underlying member method code with example usage: obj.test_escape_hatch() without return types