当我通过jenkins在远程从机上运行jmeter测试时,我不断收到以下错误(错误代码如下):
[INFO] -------------------------------------------------------
[INFO] P E R F O R M A N C E T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO]
[info]
[debug] JMeter is called with the following command line arguments: -n -t C:\Performance_Framework\Project\src\test\jmeter\Example.jmx -l C:\Performance_Framework\Project\target\jmeter\results\Example.jtl -d C:\Performance_Framework\Project\target\jmeter -L DEBUG -j C:\Performance_Framework\CMS\target\jmeter\logs\Example.jmx.log -r -R 10.0.20.100,10.0.20.101 -X -Djava.rmi.server.hostname 10.0.20.200 -Dsun.net.http.allowRestrictedHeaders true
[info] Executing test: Example.jmx
[info] Creating summariser <summary>
[info] Created the tree successfully using C:\Performance_Framework\Project\src\test\jmeter\Example.jmx
[info] Configuring remote engine: 10.0.20.100
[info] error unmarshalling return; nested exception is:
[info] java.lang.ClassNotFoundException: org.apache.jmeter.engine.RemoteJMeterEngineImpl_Stub (no security manager: RMI class loader disabled)
[info] Failed to configure 10.0.20.100
[info] Configuring remote engine: 10.0.20.101
[info] error unmarshalling return; nested exception is:
[info] java.lang.ClassNotFoundException: org.apache.jmeter.engine.RemoteJMeterEngineImpl_Stub (no security manager: RMI class loader disabled)
[info] Failed to configure 10.0.20.101
[info] Stopping remote engines
[info] Remote engines have been stopped
[info] Error in NonGUIDriver java.lang.RuntimeException: Following remote engines could not be configured:[10.0.20.100, 10.0.20.101]
[info] Completed Test: Example.jmx
现在,我的当前POM设置为机器:
<configuration>
--------------------------------
<propertiesSystem>
<java.rmi.server.hostname>10.0.20.200</java.rmi.server.hostname>
</propertiesSystem>
<remoteConfig>
<startServersBeforeTests>true</startServersBeforeTests>
<serverList>10.0.20.100,10.0.20.101</serverList>
<stopServersAfterTests>true</stopServersAfterTests>
</remoteConfig>
</configuration>
如果我从JMETER GUI运行测试,一切正常,远程主机成功启动并执行测试。
我认为一切都设置正确,jmeter-server.bat在每个从服务器上运行测试之前启动。
还有一些我不明白的东西,从这句话上从jmeter maven插件wiki:
运行发送到JMeter远程命令,当您第一次测试开始时,它将启动您在www.example.com中定义任何远程服务jmeter.properties器
如果jmeter.properties是的话,我不知道该如何定义,因为每次测试运行时目标文件夹总是被清理,产生的jmeter属性文件被导出。
**稍后编辑:**我甚至创建了jmeter.properties文件,并在src/test/jmeter目录中添加了该文件,并在其中定义了远程主机,但仍然一无所获。
那你们有什么建议?
2条答案
按热度按时间dkqlctbz1#
我通过编辑jmeter-server文件(也添加java. rmi. server. hostname),以某种方式解决了连接问题。
但我不喜欢的是测试执行时间,这是可怕的,即使有一个线程,这是应该在不到1-2秒内完成,但它仍然显示,正在试图接收关闭消息。
jenkins那边出了什么问题吗,tomcat webapp?
vd8tlhqk2#
首先需要修复的是服务器地址:https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Remote-Server-Configuration
10.0.x.100,10.0.x.101不是正确IP地址这是您在错误日志中看到内容