jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Shao <>
Subject Jmeter remote test with JAVA causing master to hang
Date Sun, 02 Dec 2018 08:57:29 GMT

I’m using Jmeter 4.0 and trying to use the remote testing feature, with the remote slave
being ready (using same 4.0 version as master; firewall turned off; ./bin/jmeter-server started).

When master driver program triggers the test, I can see the slave console showing starts and
finishes the test, however master driver program just hangs there. Not sure what is causing
this, could someone give me any pointer?

My JAVA driver code:

ClientJMeterEngine jmeter = new ClientJMeterEngine(REMOTE_HOST_ADDR);

HashTree testPlanTree = new HashTree();

Map<String, Integer> testClassMap = getAllTestClasses();
//logic to form the core test plan tree
addLoadTestToTestPlan(testPlanTree, testClassMap, SAMPLE_SLEEP_TIME);

SaveService.saveTree(testPlanTree, new FileOutputStream(TEST_PLAN));

Summariser summer = null;
String summariserName = JMeterUtils.getPropDefault("", "summary");
if (summariserName.length() > 0) {
    summer = new Summariser(summariserName);

// Store execution results into a .jtl file
ResultCollector logger = new ResultCollector(summer);
testPlanTree.add(testPlanTree.getArray()[0], logger);

// Run Test Plan

The trivial test class which implements JavaSamplerClient doesn’t really do much in the
runTest() logic (no logic in setup/tearDown):
public SampleResult runTest(JavaSamplerContext context) {
    SampleResult result = new SampleResult();

    try {
        result.setResponseMessage("test success from host: " + InetAddress.getLocalHost().getHostName());
    } catch (Exception ex) {}

    return result;

The test plan imx file generated is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="4.0" jmeter="4.0 r1823414">
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Java Load Test Plan">
      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel"
testclass="Arguments" testname="User Defined Variables" enabled="true">
        <collectionProp name="Arguments.arguments"/>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group">
        <intProp name="ThreadGroup.num_threads">2</intProp>
        <intProp name="ThreadGroup.ramp_time">2</intProp>
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel"
          <boolProp name="LoopController.continue_forever">false</boolProp>
          <intProp name="LoopController.loops">1</intProp>
        <JavaSampler guiclass="JavaTestSamplerGui" testclass="JavaSampler" testname="Jmeter_LoadTest_DummyTest">
          <elementProp name="arguments" elementType="Arguments">
            <collectionProp name="Arguments.arguments">
              <elementProp name="SleepTime" elementType="Argument">
                <stringProp name="">SleepTime</stringProp>
                <stringProp name="Argument.value">1000</stringProp>
          <stringProp name="classname">DummyTest</stringProp>

Appreciate any help!


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message