The raw TCP mock servers used in tests 1-3 caused 5-minute CI timeouts. The issue was two-fold: 1. defer conn.Close() fired before the kernel TCP send buffer was drained, so HTTP headers never reached the client and it blocked forever waiting. 2. Even with an explicit 200ms sleep before Close(), the CI environment under load sometimes didn't drain the buffer in time, causing the 5-minute idle timeout (A2A_IDLE_TIMEOUT_SECONDS) to fire. Switch to httptest.Server with http.Hijack(): - httptest.Server handles the HTTP listener lifecycle properly. - Hijack() gives direct access to the raw TCP connection after HTTP headers are parsed, bypassing the buffered writer. - Flush() before Hijack() ensures data reaches the kernel TCP buffer. - Immediate conn.Close() after Flush() triggers a read error on the HTTP client (connection reset / EOF) even though headers arrived. This matches the pattern already proven in a2a_proxy_test.go for similar partial-body connection-drop scenarios. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| cmd | ||
| internal | ||
| migrations | ||
| pkg/provisionhook | ||
| .air.toml | ||
| .ci-force | ||
| .gitignore | ||
| .golangci.yaml | ||
| Dockerfile | ||
| Dockerfile.dev | ||
| Dockerfile.tenant | ||
| entrypoint-tenant.sh | ||
| go.mod | ||
| go.sum | ||