You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2020/10/01 20:44:31 UTC

[GitHub] [trafficserver] dragon512 commented on a change in pull request #7232: Fix lua_states_stats Au test.

dragon512 commented on a change in pull request #7232:
URL: https://github.com/apache/trafficserver/pull/7232#discussion_r498501457



##########
File path: tests/gold_tests/pluginTest/lua/lua_states_stats.test.py
##########
@@ -67,36 +71,27 @@
 ps.Env = ts.Env
 ps.ReturnCode = 0
 ps.Streams.stdout.Content = Testers.ContainsExpression("proxy.config.plugin.lua.max_states: 4", "expected 4 states")
-tr.TimeOut = 5
 tr.StillRunningAfter = ts
 
 # 1 Test - Exercise lua script
 tr = Test.AddTestRun("Lua hello")
 ps = tr.Processes.Default  # alias
 ps.Command = curl_and_args + ' http://hello/hello'
-ps.TimeOut = 5
 ps.ReturnCode = 0
 ps.Streams.stderr.Content = Testers.ContainsExpression("Hello, World", "hello world content")
-tr.TimeOut = 5
 tr.StillRunningAfter = ts
 
 # 2 Test - Check for metrics
 tr = Test.AddTestRun("Check for metrics")
-tr.DelayStart = 15  # 5s lag on metrics to update
-tr.TimeOut = 5
 ps = tr.Processes.Default  # alias
-ps.Env = ts.Env
-ps.Command = "traffic_ctl metric match lua"
+ps.Command = "bash -c '" + Test.TestDirectory + "/metrics.sh " + Test.TestDirectory + "'"

Review comment:
       Don't run stuff in the test directory. Copy this to the sandbox and run it

##########
File path: tests/gold_tests/pluginTest/lua/lua_states_stats.test.py
##########
@@ -67,36 +71,27 @@
 ps.Env = ts.Env
 ps.ReturnCode = 0
 ps.Streams.stdout.Content = Testers.ContainsExpression("proxy.config.plugin.lua.max_states: 4", "expected 4 states")
-tr.TimeOut = 5
 tr.StillRunningAfter = ts
 
 # 1 Test - Exercise lua script
 tr = Test.AddTestRun("Lua hello")
 ps = tr.Processes.Default  # alias
 ps.Command = curl_and_args + ' http://hello/hello'
-ps.TimeOut = 5
 ps.ReturnCode = 0
 ps.Streams.stderr.Content = Testers.ContainsExpression("Hello, World", "hello world content")
-tr.TimeOut = 5
 tr.StillRunningAfter = ts
 
 # 2 Test - Check for metrics
 tr = Test.AddTestRun("Check for metrics")
-tr.DelayStart = 15  # 5s lag on metrics to update
-tr.TimeOut = 5
 ps = tr.Processes.Default  # alias
-ps.Env = ts.Env
-ps.Command = "traffic_ctl metric match lua"
+ps.Command = "bash -c '" + Test.TestDirectory + "/metrics.sh " + Test.TestDirectory + "'"
 ps.Env = ts.Env
 ps.ReturnCode = 0
-ps.Streams.stdout = "gold/metrics.stdout.gold"
 tr.StillRunningAfter = ts
 
 # 3 Test - Check for developer lifecycle stats
 tr = Test.AddTestRun("Check for lifecycle stats")
 ps = tr.Processes.Default  # alias
-ps.Command = "traffic_ctl plugin msg ts_lua print_stats"
+ps.Command = "bash -c '" + Test.TestDirectory + "/lifecycle_stats.sh " + Test.TestDirectory + "'"

Review comment:
       Same here..  One should almost never need to call Test.TestDirectory.
   
   Just add someplace a `Test.Copy('lifecycle_stats.sh")` 




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

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