当我通过远程从机上的詹金斯运行 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 上的这句话中不明白的东西:
runremote 命令发送到 JMeter,它将在您的第一个测试开始时启动您在 jmeter.properties 中定义的任何远程服务器。
项目的哪个 jmeter.properties 文件?如果是,那么我不知道如何将其定义为始终在每次测试运行时清理目标文件夹,从而导出生成的 jmeter 属性文件。
后来编辑:我什至创建了 jmeter.properties 文件并添加到 src/test/jmeter 目录中并在那里定义了远程主机,但仍然没有。
那么各位小伙伴们有什么建议呢?