bneradt commented on code in PR #13322:
URL: https://github.com/apache/trafficserver/pull/13322#discussion_r3470556309


##########
tests/gold_tests/pluginTest/slice/slice_prefetch.test.py:
##########
@@ -180,4 +181,30 @@
     cache_file,
     r'\*/18 hit-fresh, none$',
 )
-ts.Disk.File(cache_file).Content = "gold/slice_prefetch.gold"
+cache_log = ts.Disk.File(cache_file)
+expected_cache_entries = [
+    "bytes 0-6/18 miss",
+    "bytes 7-13/18 miss",
+    "bytes 14-17/18 miss",
+    "bytes 14-17/18 hit-fresh",
+    "- miss, none",
+    "bytes 0-6/18 hit-fresh",
+    "bytes 7-13/18 hit-fresh",
+    "bytes 14-17/18 hit-fresh",
+    "- hit-fresh, none",
+    "bytes 0-6/18 hit-stale",
+    "bytes 7-13/18 hit-stale",
+    "bytes 14-17/18 hit-stale",
+    "- hit-stale, none",
+    "bytes 0-17/18 hit-fresh, none",
+    "bytes 0-4/18 miss",
+    "bytes 5-9/18 miss",
+    "bytes 10-14/18 miss",
+    "bytes 15-17/18 miss",
+    "bytes 10-14/18 hit-fresh",
+    "bytes 15-17/18 hit-fresh",
+    "bytes 5-16/18 miss, none",
+    "*/18 hit-fresh, none",
+]
+for entry in expected_cache_entries:
+    cache_log.Content += Testers.ContainsExpression(f'^{re.escape(entry)}$', 
f'Verify cache log contains: {entry}')

Review Comment:
   initialized cache_log.Content before += and made the per-entry regex 
explicitly multiline.



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