1

当我通过远程从机上的詹金斯运行 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 目录中并在那里定义了远程主机,但仍然没有。

那么各位小伙伴们有什么建议呢?

4

2 回答 2

0

我通过添加 java.rmi.server.hostname 来编辑 jmeter-server 文件,以某种方式解决了连接问题。

但我不喜欢的是测试执行时间,这太可怕了,即使有一个线程应该在 1-2 秒内完成,但它仍然显示正在尝试接收关闭消息。

[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\CMS\src\test\jmeter\Example.jmx -l C:\Performance_Framework\CMS\target\jmeter\results\Example.jtl -d C:\Performance_Framework\CMS\target\jmeter -L DEBUG -q C:\Performance_Framework\CMS\src\test\jmeter\jmeter.properties -j C:\Performance_Framework\CMS\target\jmeter\logs\Example.jmx.log -r -X -Djava.rmi.server.hostname 10.0.20.200 -Dsun.net.http.allowRestrictedHeaders true
[info] Executing test: SearchForModule.jmx

[info] Creating summariser <summary>
[info] Created the tree successfully using C:\Performance_Framework\CMS\src\test\jmeter\SearchForModule.jmx
[info] Configuring remote engine: 10.0.20.100
[info] Configuring remote engine: 10.0.20.101
[info] Starting remote engines
[info] Starting the test @ Thu Jul 30 13:48:23 BST 2015 (1438260503717)

[info] Remote engines have been started
[info] Waiting for possible shutdown message on port 4445

jenkins方面有什么问题吗,tomcat webapp?

于 2015-07-30T13:00:50.587 回答
-1

您需要修复的第一件事是服务器地址: https ://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Remote-Server-Configuration

10.0.x.100,10.0.x.101 不是正确的 IP 地址。这是您可以在错误日志中看到的内容。

于 2015-07-29T12:39:28.563 回答