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


##########
tests/gold_tests/logging/pqsi-pqsp.test.py:
##########
@@ -78,10 +78,12 @@
 
 log_filespec = os.path.join(ts.Variables.LOGDIR, 'field-test.log')
 
-# Wait for the cache-hit line to be written.
+# Wait for both transaction log lines to be written. Their write order is not
+# deterministic.
+Test.AddAwaitFileContainsTestRun('Await pqsi/pqsp cache-miss line.', 
log_filespec, r'^127\.0\.0\.1 [1-6][0-9]*$')
 Test.AddAwaitFileContainsTestRun('Await pqsi/pqsp cache-hit line.', 
log_filespec, r'^0 0$')
 
 tr = Test.AddTestRun()
-tr.Processes.Default.Command = "sed '1s/^127.0.0.1 [1-6][0-9]*$$/abc/' < " + 
log_filespec
+tr.Processes.Default.Command = "sed 's/^127.0.0.1 [1-6][0-9]*$$/abc/' < " + 
log_filespec + " | LC_ALL=C sort"

Review Comment:
   The `sed` pattern treats `.` as “any character”, so it would also match 
unexpected addresses (since `127.0.0.1` is not escaped). For consistency with 
the await regex (which correctly escapes `.`) and to make the normalization 
precise, escape the dots in the `sed` expression.



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