Copilot commented on code in PR #13489:
URL: https://github.com/apache/trafficserver/pull/13489#discussion_r3715197584
##########
tests/gold_tests/chunked_encoding/server2.sh:
##########
@@ -38,4 +38,4 @@ response ()
}
outfile=$2
-response | nc -l $1 > "$outfile"
+response | nc -lk "$1" > "$outfile"
Review Comment:
`nc -k` changes the server process lifetime: the listener can remain alive
after the single `response` producer exits (stdin EOF), potentially causing the
AuTest process to run indefinitely unless the harness forcibly terminates it.
To keep the original one-shot behavior while still tolerating a readiness
probe, consider explicitly limiting how many connections are accepted (e.g.,
allow one probe connection and one real request) and then exiting
deterministically.
##########
tests/gold_tests/chunked_encoding/server3.sh:
##########
@@ -38,4 +38,4 @@ response ()
}
outfile=$2
-response | nc -l $1 > "$outfile"
+response | nc -lk "$1" > "$outfile"
Review Comment:
The `-k` flag is not supported consistently across all `nc` implementations
(e.g., differences between traditional netcat / OpenBSD netcat / nmap's ncat).
Since these are portable tests, it would be safer to avoid relying on `-k`
(e.g., implement a small accept loop using `nc -l` or use a tool with stable
semantics in CI).
##########
tests/gold_tests/pluginTest/stale_response/stale_response_max_memory.replay.yaml:
##########
@@ -77,6 +77,10 @@ sessions:
- [ Connection, close ]
- [ Cache-Control, "max-age=1" ]
- [ X-Response, oversized-origin-response ]
+ # Pad the complete response header to the 256-byte limit plus the
+ # one-byte overflow sentinel. This makes the memory rejection
+ # independent of how the response body is split across reads.
+ - [ X-Padding, aaaaaaaaaaaaaaaaaaaaaaaaaaaaa ]
Review Comment:
The test depends on the *total* serialized header size being exactly at the
cap-plus-sentinel boundary, but the padding length is not self-evident and can
easily drift if any other header text changes. To keep this deterministic
long-term, consider documenting the computed byte accounting (e.g., expected
total header bytes and how many bytes `X-Padding` contributes) or introducing
an explicit assertion/check in the test harness that the header block is the
intended size.
--
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]