0
votes

I have a JMeter test which i have been using for more than 6 months. Currently I have been running this via command line (no ANT) in non GUI mode.

This is what i do when i run via command line

"%JMETER_HOME%\bin\jmeter.bat" -n -t %TESTNAME% -p %PROPPATH% -l %RESULTPATH% -j %LOGPATH% -Djmeter.save.saveservice.output_format=xml -Djmeter.save.saveservice.thread_counts=true

I recently thought of using Ant. Whenever I run the same test (ofcourse for testing the same application) - I get below error.

Non HTTP response code: org.apache.http.NoHttpResponseException - Non HTTP response message: The target server failed to respond

There is no issue with the application and the application works perfectly fine - no exception in the log. If I do not use Ant - the error disappears. I tried again and again - w/ Ant & w/o Ant - 5 times. I get the error consistently when i use Ant.

I always the save the result in XML format, pass the same property files. No other differences.

This is from my Ant build file.

    <jmeter
        jmeterhome="${jmeter.home}"
        testplan ="${test.path}/${test.name}.jmx"
        resultlog="${test.result.path}/${test.name}.jtl"
        jmeterproperties="${test.properties}/${property.file.name}.properties"
        jmeterlogfile="${test.result.log}/jmeter.log"
        >
        <property name="jmeter.save.saveservice.output_format" value="xml"/>
        <property name="jmeter.save.saveservice.assertion_results" value="all"/>
        <property name="jmeter.save.saveservice.thread_counts" value="true"/>
        <property name="jmeter.save.saveservice.bytes" value="true"/>
        <property name="file_format.testlog" value="2.1"/>
        <property name="jmeter.save.saveservice.response_data.on_error" value="false"/>
        <property name="includecontroller.prefix" value="${basedir}/test/modules/"/>
    </jmeter>

I have no idea what is wrong here.

Also the issue i am facing with Ant happens only after 15 mins of run. not immediately. Looks like something related with memory...not sure.

EDIT::

As Dimitri has said, This is the available memory i have

Command line = 499Mb

Ant = 247Mb

Environment variable in the machine

ANT_OPTS=-Xmx1024m -Xms512m This is the machine detail where i run my test with 200 users. enter image description here

1
Try adding following line between last <property> and </jmeter>` <jvmarg value="-Xmx4G"/> or what is abour 70%-80% of available physical memory of your load generator hostDmitri T

1 Answers

1
votes

My expectation is that you're missing the following stanza in command-line mode:

jmeterproperties="${test.properties}/${property.file.name}.properties"

I bet that host is defined under that ".properties" file and JMeter in command-line mode doesn't read this file.

Command line equivalent will be -p or -q option.

    -p, --propfile <argument>
            the jmeter property file to use
    -q, --addprop <argument>
            additional JMeter property file(s)

Alternatively you can set properties via -J command line argument as

jmeter -Jproperty1name=property1value -Jproperty2name=property2value -n -t ...

Third option is to put everything in jmeter.properties or user.properties file which live under /bin folder of your JMeter installation.

See Apache JMeter Properties Customization Guide for more details.