Copilot commented on code in PR #13269:
URL: https://github.com/apache/trafficserver/pull/13269#discussion_r3416846388


##########
tests/gold_tests/cripts/cripts.test.py:
##########
@@ -46,6 +46,18 @@ def setUpOriginServer(self):
         }
         self.server.addResponse("sessionfile.log", request_header, 
response_header)
 
+        query_request_header = {
+            "headers": "GET /query HTTP/1.1\r\nHost: www.example.com\r\n\r\n",

Review Comment:
   The origin server response matcher is configured for `Host: www.example.com` 
and `GET /query`, but the test request sends `Host: query.example.com` and 
includes a query string (`/query?foo=1&bar=2&baz=3`). This mismatch can prevent 
the origin server from returning the intended 200 response, making the gold 
test flaky or failing.



##########
src/cripts/tests/query_test.cc:
##########
@@ -31,6 +31,10 @@ do_remap()
 {
   borrow url = Client::URL::get();
 
+  // Copy-construct Query to exercise the explicit copy ctor (Query owns a 
std::unique_ptr<State>).
+  // Note: this remains tied to the same underlying URL; it is not an 
independent snapshot.
+  cripts::Url::Query query_copy = url.query;
+

Review Comment:
   `query_copy` is constructed before the live query has been parsed, so 
`_state` will typically be `nullptr` and the explicit deep-copy logic won't be 
exercised (despite the comment). Force parsing (e.g., via `operator[]`) before 
copying so this test actually covers the new copy semantics.



-- 
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]

Reply via email to