背景
大周末,要開啟一個穩(wěn)定性的壓力測試,腳本必須包含混合場景
問題
腳本都寫完,調(diào)試過程中,日志打印能發(fā)起請求,并正確返回,但是有報錯信息,報錯如下:
2019-10-26 10:34:50,417 ERROR There is no test in progress.
net.grinder.script.InvalidContextException: There is no test in progress.
at net.grinder.engine.process.ScriptStatisticsImplementation.getForCurrentTest(ScriptStatisticsImplementation.java:119) ~[grinder-core-3.9.1.jar:na]
at HLS_Mix.test_AAA(HLS_Mix.groovy:124) ~[na:na]
at net.grinder.scriptengine.groovy.junit.GrinderRunner.run(GrinderRunner.java:170) ~[ngrinder-groovy-3.4.1.jar:na]
at net.grinder.scriptengine.groovy.GroovyScriptEngine$GroovyWorkerRunnable.run(GroovyScriptEngine.java:147) ~[ngrinder-groovy-3.4.1.jar:na]
at net.grinder.engine.process.GrinderThread.run(GrinderThread.java:118) ~[grinder-core-3.9.1.jar:na]
解決方案
問題定位,發(fā)現(xiàn)是@BeforeThread里的test_AAA.record(this, "test_ccc)有問題,應(yīng)該改為test_AAA.record(this, "test_AAA),問題順利解決。