ywkaras commented on code in PR #10874:
URL: https://github.com/apache/trafficserver/pull/10874#discussion_r1409757743
##########
tests/gold_tests/continuations/double.test.py:
##########
@@ -81,26 +81,30 @@
# Signal that all the curl processes have completed and poll for done metric
tr = Test.AddTestRun("Curl Done")
-tr.Processes.Default.Command = (
- "traffic_ctl plugin msg done done ; "
- "N=60 ; "
- "while (( N > 0 )) ; "
- "do "
- "sleep 1 ; "
- 'if [[ "$$( traffic_ctl metric get continuations_verify.test.done )" = '
- '"continuations_verify.test.done 1" ]] ; then exit 0 ; '
- "fi ; "
- "let N=N-1 ; "
- "done ; "
- "echo TIMEOUT ; "
- "exit 1"
-)
+tr.Processes.Default.Command = "traffic_ctl plugin msg done done"
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.Env = ts.Env
tr.StillRunningAfter = ts
+
+def make_done_stat_ready(tsenv):
+ def done_stat_ready(process, hasRunFor, **kw):
+ retval = subprocess.run(
+ "traffic_ctl metric get continuations_verify.test.done",
+ shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ env=tsenv)
+ return retval.returncode == 0 and b'1' in retval.stdout
+
+ return done_stat_ready
+
+
+watcher = Test.Processes.Process("watcher", "sleep 20")
+
# number of sessions/transactions opened and closed are equal
tr = Test.AddTestRun("Check Ssn")
+tr.Processes.Default.StartBefore(watcher, ready=make_done_stat_ready(ts.Env))
Review Comment:
If this ever failed, it would probably be less confusing in a separate test
run with a dummy echo command.
--
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]