fix(operations): preserve response processing deadlines and await routed API readiness

This commit is contained in:
2026-11-22 20:04:24 +03:00
parent f77223790d
commit 7e61bc4ee3
5 changed files with 266 additions and 3 deletions
+7 -1
View File
@@ -51,6 +51,8 @@ func TestEarlyRejectionDoesNotForwardBodyAndAcceptedBodyStillStreams(t *testing.
if err != nil {
t.Error(err)
}
// Request-body cleanup must not cancel legitimate processing.
time.Sleep(2200 * time.Millisecond)
w.Write(data)
}))
defer backend.Close()
@@ -75,7 +77,11 @@ func TestEarlyRejectionDoesNotForwardBodyAndAcceptedBodyStillStreams(t *testing.
}
defer conn.Close()
_ = conn.SetDeadline(time.Now().Add(5 * time.Second))
fmt.Fprintf(conn, "POST / HTTP/1.1\r\nHost: synthetic\r\nConnection: close\r\nContent-Type: image/png\r\nContent-Length: %d\r\n\r\n", len(payload))
connection := "keep-alive"
if reject {
connection = "close"
}
fmt.Fprintf(conn, "POST / HTTP/1.1\r\nHost: synthetic\r\nConnection: %s\r\nContent-Type: image/png\r\nContent-Length: %d\r\n\r\n", connection, len(payload))
// A load balancer can finish writing before reading the early reply.
if _, err := io.WriteString(conn, payload); err != nil {
t.Fatal(err)