You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "bneradt (via GitHub)" <gi...@apache.org> on 2024/07/24 18:39:00 UTC

[PR] prefetch autests: await log file content [trafficserver]

bneradt opened a new pull request, #11612:
URL: https://github.com/apache/trafficserver/pull/11612

   This updates the prefetch tests to await the final logged transaction content that they expect. With this patch, they now have a test run that polls for the expected content for up to a one minute timeout. This will fix some intermittent test failures for these prefetch tests which was caused by a race condition in which the checking of content was done while the log was being written. Generally the write was fast enough, but it wasn't always, resulting in an intermittent false failure due to the race.
   
   Fixes #11610


-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] prefetch autests: await log file content [trafficserver]

Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on code in PR #11612:
URL: https://github.com/apache/trafficserver/pull/11612#discussion_r1690372557


##########
tests/gold_tests/pluginTest/prefetch/prefetch_bignum.test.py:
##########
@@ -71,7 +71,15 @@
     f'curl --verbose --proxy 127.0.0.1:{ts.Variables.port} http://domain.in/texts/demo-3842948374928374982374982374.txt')
 tr.Processes.Default.ReturnCode = 0
 
+tr = Test.AddTestRun('Await transactions to finish logging.')
+p = tr.Processes.Default
+p.Command = 'echo waiting for transactions to finish logging'
+await_process = tr.Processes.Process('await', 'sleep 60')
+await_process.Ready = When.FileContains(ts.Disk.traffic_out.Name, '3842948374928374982374982377')
+await_process.StartupTimeout = 30

Review Comment:
   That's a good idea.



-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] prefetch autests: await log file content [trafficserver]

Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on code in PR #11612:
URL: https://github.com/apache/trafficserver/pull/11612#discussion_r1690312211


##########
tests/gold_tests/pluginTest/prefetch/prefetch_bignum.test.py:
##########
@@ -71,7 +71,15 @@
     f'curl --verbose --proxy 127.0.0.1:{ts.Variables.port} http://domain.in/texts/demo-3842948374928374982374982374.txt')
 tr.Processes.Default.ReturnCode = 0
 
+tr = Test.AddTestRun('Await transactions to finish logging.')
+p = tr.Processes.Default
+p.Command = 'echo waiting for transactions to finish logging'
+await_process = tr.Processes.Process('await', 'sleep 60')
+await_process.Ready = When.FileContains(ts.Disk.traffic_out.Name, '3842948374928374982374982377')
+await_process.StartupTimeout = 30

Review Comment:
   Should lines 74-79 be a function where you pass in tr and the string for FileContains?



-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] prefetch autests: await log file content [trafficserver]

Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt merged PR #11612:
URL: https://github.com/apache/trafficserver/pull/11612


-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] prefetch autests: await log file content [trafficserver]

Posted by "cmcfarlen (via GitHub)" <gi...@apache.org>.
cmcfarlen commented on PR #11612:
URL: https://github.com/apache/trafficserver/pull/11612#issuecomment-2273356166

   Cherry-picked to v10.0.x


-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] prefetch autests: await log file content [trafficserver]

Posted by "JosiahWI (via GitHub)" <gi...@apache.org>.
JosiahWI commented on PR #11612:
URL: https://github.com/apache/trafficserver/pull/11612#issuecomment-2265804787

   [approve ci autest]


-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] prefetch autests: await log file content [trafficserver]

Posted by "JosiahWI (via GitHub)" <gi...@apache.org>.
JosiahWI commented on PR #11612:
URL: https://github.com/apache/trafficserver/pull/11612#issuecomment-2265804603

   The AuTest proxy_serve_stale_dns_fail failed.


-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] prefetch autests: await log file content [trafficserver]

Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on code in PR #11612:
URL: https://github.com/apache/trafficserver/pull/11612#discussion_r1690386229


##########
tests/gold_tests/pluginTest/prefetch/prefetch_bignum.test.py:
##########
@@ -71,7 +71,15 @@
     f'curl --verbose --proxy 127.0.0.1:{ts.Variables.port} http://domain.in/texts/demo-3842948374928374982374982374.txt')
 tr.Processes.Default.ReturnCode = 0
 
+tr = Test.AddTestRun('Await transactions to finish logging.')
+p = tr.Processes.Default
+p.Command = 'echo waiting for transactions to finish logging'
+await_process = tr.Processes.Process('await', 'sleep 60')
+await_process.Ready = When.FileContains(ts.Disk.traffic_out.Name, '3842948374928374982374982377')
+await_process.StartupTimeout = 30

Review Comment:
   I added a `Test` extension to do this. That way any autests can re-use this implementation.
   
   Thanks for suggesting breaking this out into a reusable module.



-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org