Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jmeter report doesnt created #6329

Open
mohamed-atef2022 opened this issue Aug 6, 2024 · 11 comments
Open

Jmeter report doesnt created #6329

mohamed-atef2022 opened this issue Aug 6, 2024 · 11 comments

Comments

@mohamed-atef2022
Copy link

mohamed-atef2022 commented Aug 6, 2024

i am trying to run jmeter through argowork flow , the flow is working fine here is the logs and the reports is created empty without any data , i am tried many options but cant solve it
``
024-08-06 13:44:09,121 ERROR o.a.j.JMeter: Error in NonGUIDriver
java.lang.IllegalArgumentException: Results file:/report/zuhauseplus_debug_test.jmx_2024-08-06_134252.jtl is not empty
at org.apache.jmeter.report.dashboard.ReportGenerator.(ReportGenerator.java:140) ~[ApacheJMeter_core.jar:5.6.3]
at org.apache.jmeter.JMeter.runNonGui(JMeter.java:1007) [ApacheJMeter_core.jar:5.6.3]
at org.apache.jmeter.JMeter.startNonGui(JMeter.java:940) [ApacheJMeter_core.jar:5.6.3]
at org.apache.jmeter.JMeter.start(JMeter.java:508) [ApacheJMeter_core.jar:5.6.3]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.apache.jmeter.NewDriver.main(NewDriver.java:259)

@linvaux
Copy link
Contributor

linvaux commented Aug 8, 2024

add jmeter arg -f

@mohamed-atef2022
Copy link
Author

this is th code i use
in which line i should edit
if [ -n "${enable_report}" ]; then
# report_command_line="--reportatendofloadtests --reportoutputfolder /report/report-${jmx}-$(date +"%F_%H%M%S")"
report_command_line="--reportatendofloadtests --reportoutputfolder /report/report-${jmx}-{{workflow.creationTimestamp}}"
fi

kubectl cp -c jmmaster "/tmp/scenario.properties" -n "${namespace}" "${master_pod}:/tmp/scenario.properties"

shellcheck disable=SC2145

echo "slave_array=(${slave_array[@]}); index=${slave_num} && while [ ${index} -gt 0 ]; do for slave in ${slave_array[@]}; do if echo 'test open port' 2>/dev/null > /dev/tcp/${slave}/1099; then echo ${slave}' ready' && slave_array=(${slave_array[@]/${slave}/}); index=$((index-1)); else echo ${slave}' not ready'; fi; done; echo 'Waiting for slave readiness'; sleep 2; done" >"/tmp/load_test.sh"
{
echo "cd /opt/jmeter/apache-jmeter/bin"
echo "timeout ${duration}s jmeter ${param_user} ${param_properties} ${report_command_line} --logfile /report/${jmx}$(date +"%F%H%M%S").jtl --nongui --testfile ${jmx} -Dserver.rmi.ssl.disable=true --remoteexit --remotestart ${slave_list} >> jmeter-master.out 2>> jmeter-master.err"
echo "jmeter -G ${param_user} ${param_properties} ${report_command_line} --logfile /report/${jmx}$(date +"%F%H%M%S").jtl --nongui --testfile ${jmx} -Dserver.rmi.ssl.disable=true --remoteexit --remotestart ${slave_list} >> jmeter-master.out 2>> jmeter-master.err &"
echo "trap 'sleep 15 && kill -10 1' EXIT INT TERM"
echo "java -jar /opt/jmeter/apache-jmeter/lib/jolokia-java-agent.jar start JMeter >> jmeter-master.out 2>> jmeter-master.err"
echo "echo "Starting load test at : $(date)" "

@FSchumacher
Copy link
Contributor

The error message wants to tell you, that the sample log file already exists and is not empty.

To fix this, discard the file (save it somewhere?) before starting the test run.

Maybe workflow.creationTimestamp is constant relative to all your test runs?

PS. Why do you use so much "echo 'some shell code'" that seems quite unreadable to me. And instead of disabling a shell-check rule, try to fix the code.

@linvaux
Copy link
Contributor

linvaux commented Aug 11, 2024

@mohamed-atef2022 Why you show some shell code? you could add jmeter arg -f to delete logfile before rerun test, such as

jmeter -n -t script.jmx -l result.jtl -e -o ./report -f

@mohamed-atef2022
Copy link
Author

mohamed-atef2022 commented Aug 13, 2024

i tried to solve it by fixing the echo commands
the report generated but i get this issue which prevent the report from copying in th path
``
2024-08-12 12:32:21,056 INFO o.a.j.r.d.ReportGenerator: Exporting data using exporter:'html' of className:'org.apache.jmeter.report.dashboard.HtmlTemplateExporter'
2024-08-12 12:32:21,059 INFO o.a.j.r.d.HtmlTemplateExporter: Will generate dashboard in folder: /report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z
2024-08-12 12:32:21,287 INFO o.a.j.r.d.HtmlTemplateExporter: Report will be generated in: /report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z, creating folder structure
2024-08-12 12:32:21,289 INFO o.a.j.r.d.TemplateVisitor: Copying folder from '/opt/jmeter/apache-jmeter-5.6.3/bin/report-template' to '/report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z', got message: /report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z, found non empty folder with following content [/report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z/statistics.json], will be ignored
2024-08-12 12:32:21,777 INFO o.a.j.JMeter: Dashboard generated

@mohamed-atef2022
Copy link
Author

@linvaux while i am using -f in jmeter command
i think it doeesnt affect on the report creation or
overwrite it

@linvaux
Copy link
Contributor

linvaux commented Aug 14, 2024

@linvaux while i am using -f in jmeter command i think it doeesnt affect on the report creation or overwrite it

-f while delete the old logfile and try to generate new report, see

@mohamed-atef2022
Copy link
Author

i tried to add the flag itself
jmeter ${param_user} ${param_properties} ${report_command_line} --logfile report-${jmx}-$(date +"%F_%H%M%S").jtl --nongui --forceDeleteResultFile --testfile ${jmx} -Dserver.rmi.ssl.disable=true --remoteexit --remotestart ${slave_list} >> jmeter-master.out 2>> jmeter-master.err
i tried also to delete it explicity from the container
but i get also this
2024-08-12 12:32:21,287 INFO o.a.j.r.d.HtmlTemplateExporter: Report will be generated in: /report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z, creating folder structure
2024-08-12 12:32:21,289 INFO o.a.j.r.d.TemplateVisitor: Copying folder from '/opt/jmeter/apache-jmeter-5.6.3/bin/report-template' to '/report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z', got message: /report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z, found non empty folder with following content [/report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z/statistics.json], will be ignored
2024-08-12 12:32:21,777 INFO o.a.j.JMeter: Dashboard generated

@linvaux
Copy link
Contributor

linvaux commented Aug 14, 2024

It looks like your report directory is not empty when jemter generating report, could you check the report dir is empty?
by the way could you use markdown to replay when you show your code?

@mohamed-atef2022
Copy link
Author

i jus checked it
th report directory has a data called report-template it is copied from /opt/jmeter/bin/report-template
i think it is a files that copied to be filled in by the load test result
but what i am confusing about why the flag of -f doesnt work
to overwrite the data

@linvaux
Copy link
Contributor

linvaux commented Aug 16, 2024

@mohamed-atef2022 emm,you want to use jmeter cluster to run test and generate report?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants