0

So we are doing distributed testing of our web-app using JMeter. For that you need to have the jmeter-server.bat file running in background as it acts as sort of a listener. The problem arises when one of the slave machine out of 4 restarts due to the load and the test is effectively stuck right there as the master machine expects some output from the 4th machine. Currently the automation is done via ansible-playbooks which are called in Jenkins. There are more or less 15 tests that are downstream to one another. So even if one test is stuck, the time is wasted until someone check on the machines.

Things I've tried so far:

I've tried using the Windows Task Scheduler and kept the jmeter-server.bat to run without any user loggin in, but it starts the bat file in background which in-turn spawns all the child processes in the background as well i.e. starts Selenium Chrome in headless mode.

I've tried adding the jmeter-server.bat in startup and configuring the system to AutoLogon without any password to trigger a session which will call the startup file. But unfortunately the idea was scrapped by IT for being insecure.

Tried using the ansible playbook by using the win_command but it again gets stuck as the batch file never returns anything.

Created a service as well for the bat file, but again the child processes started in background.

KisS
  • 1
  • What about using Autoit or Powershell? Autoit with RunAs should do what you want. You could also run an Autoit script that checks whether your processes are up and running and if not, then restart your stuff. – Xenobiologist Feb 13 '23 at 07:41
  • @Xenobiologist Tried AutoIT with Ansible. It runs when a windows session is already created. However when the VM restarts, and is waiting for a session to be created, the playbook fails as it has no session. – KisS Feb 14 '23 at 07:26

1 Answers1

1

The problem arises when one of the slave machine out of 4 restarts due to the load

Instead of trying to work around the issue I would rather recommend finding the root cause and fixing it.

  1. Make sure to follow JMeter Best Practices
  2. Configure Java to take heap dump on failure
  3. Inspect Windows PerfMon and operating system/application logs
  4. Check presence of .hprof files in the "bin" folder of your JMeter installation and see what do they say

In general using Selenium for conducting the load is not recommended, I would rather suggest using JMeter's HTTP Request samplers for that, given you properly configure JMeter to behave like a real browser from the system under test perspective there won't be any difference whether the load comes from HTTP Request samplers or from the real browser.

The same states documentation on the WebDriver Sampler

Note: It is NOT the intention of this project to replace the HTTP Samplers included in JMeter. Rather it is meant to compliment them by measuring the end user load time.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks. Will definitely check it out. But as of now most of our tests are based on Selenium. So it would be a task on its own to port it. – KisS Feb 14 '23 at 07:29