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


##########
tests/gold_tests/pluginTest/stale_response/stale_response.test.py:
##########
@@ -137,28 +137,20 @@ def setupClient(self, tr: 'TestRun') -> None:
 
     def verify_plugin_log(self) -> None:
         """Verify the contents of the stale_response plugin log."""
-        tr = Test.AddTestRun("Verify stale_response plugin log")
-        name = f'log_waiter_{TestStaleResponse._ts_counter}'
-        log_waiter = tr.Processes.Process(name)
-        log_waiter.Command = 'sleep 30'
+        swr_log_pattern = "stale-while-revalidate:.*stale.jpeg"
+        sie_log_pattern = "stale-if-error:.*error.jpeg"
+
+        def expect_log_entry(pattern: str, description: str) -> None:
+            Test.AddAwaitFileContainsTestRun(f"Await {description}", 
self._ts.Disk.stale_responses_log.AbsPath, pattern)
+            self._ts.Disk.stale_responses_log.Content += 
Testers.ContainsExpression(pattern, f"Verify {description}")
+
         if self._option_type == OptionType.FORCE_SWR:

Review Comment:
   The await TestRuns created by `Test.AddAwaitFileContainsTestRun` don’t 
currently declare the ATS process as `StillRunningBefore/After`. In the default 
(non-force) case you add two await runs; without keeping `self._ts` running 
after the first await, the harness can tear ATS down between awaits, which can 
reintroduce directive-missing flakiness.
   
   Capture the returned TestRun and mark `self._ts` as still running before 
each await, and still running after the first await when a second await follows 
(so ATS can continue flushing the log).



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