bryancall commented on PR #12886: URL: https://github.com/apache/trafficserver/pull/12886#issuecomment-3911009838
The consistent AuTest 1of4 failure was caused by a fundamental incompatibility between `nc -l` and `When.PortOpen()`: `nc -l` only accepts a **single TCP connection**. The `PortOpen` readiness probe connects to check the port is open, consuming that one connection. When ATS then tries to proxy the request to the origin, the port is dead → 502 every time. This is why it failed deterministically on all 4 CI retries. **The fix** (pushed in `3cf53d3`) replaces `server1.sh` with a new shared `tests/tools/mock_origin.py` that: 1. Uses Python `socket.listen()` which handles multiple `accept()` calls, so readiness probes are absorbed silently 2. Sends the configured HTTP response after reading request headers 3. **Drains remaining request data** before closing — without this, closing the connection mid-POST causes a TCP RST that makes ATS return 502 on HTTP/2 streams (this was a second issue discovered during testing) `mock_origin.py` is a reusable tool that can replace all the ad-hoc `nc -l` server scripts in the test suite (`post/server1.sh`, `chunked_encoding/server2-4.sh`, `post_slow_server/server.sh`). It supports configurable status codes, response bodies (content-length or chunked), and response delays via CLI args. Tested **5/5 parallel ASAN runs** passing on a local dev machine. The previous `mock_origin.py` without the drain fix was failing ~2/3 parallel runs on the HTTP/2 test case. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
