Why do some threads not close/ stop within my session of JMeter?
I have a simple https request to a URL, 1500users, 20second ramp up, 5 iteration
For some reason the threads freeze when ramping down, for example 1500users would ramp down but when reach around the 30mark the 30 threads freeze and dont stop, any ideas?
Don't ever run your JMeter tests in GUI mode, use GUI only for tests development and/or debugging. When it comes to load test execution make sure you run your test in command-line non-GUI mode.
Also make sure you are following JMeter Best Practices and recommendations from 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article.
Related
Testing a multithreaded application with JUnit5, the automated tests run just fine.
But in manual debugging, the environment misbehaves, and I would like to know how to get it to act as it should.
IntelliJ (using the Java VM + its debugger) has two general options to suspend on breakpoints: either "All" = all threads, or "Thread" = the current thread only.
(Which thread is "the current thread" may be unclear and causing issues, but that's been discussed separately, see other issues here on stackOverflow.)
Wanted behaviour:
a breakpoint to suspend a specific thread, and the JUnit test environment, which is part of the IDE debugging.
Actual behaviour:
either all threads are suspended, even those which should be running
or only a single thread is suspended, and JUnit #AfterEach/#AfterAll annotations kill the resources currently debugged, terminating the threads that should be running, etc.
How to achieve the Wanted behaviour?
(Environment: AdoptOpenJDK8, AdoptOpenJDK11 in Java 9 mode, IntelliJ 2020.3, JUnit-Jupiter 5.7.0)
You can use two breakpoints. The one you're really interested in and another one in your unit test (somewhere between calling the code under test and cleaning up). Set both to only suspend the current thread.
I am using JMeter to do stress testing to my project.
I set the Constant Throughout Timer as 20/s, and last for 100s. But the actual is: the TPS most get 7/s, and never get 20/s. I don't know why is this.
I want to ask 2 questions:
1、As my understanding, the JMeter can simulate the stress so it can get TPS at 20/s, is there any config wrong of my JMeter?
2、If for other case, the Jmeter can simulate the stress only depend on the server, is it mean there is problem with my server lead to the TPS can't be improved?
Constant Throughput Timer can only pause the threads in order to limit JMeter to the defined number of requests per minute. Moreover, it's more or less precise only on "minute" level, if your test lasts less - you may not see the impact.
Another factor is application response time as JMeter waits for the previous response before sending the next request therefore if the application doesn't respond fast enough you will not be able to reach the desired number of requests per second
And last but not the least is that JMeter should have enough resources in order to send required number of requests per second because if JMeter is not properly configured or the machine where JMeter is running is overloaded - you will not be able to send requests fast enough even the application can handle more load.
So recommendations are:
Make sure you provide enough threads (virtual users) to conduct the required load in the Thread Group
Make sure to follow JMeter Best Practices
Make sure to monitor the baseline health metrics of the machine where JMeter is running (CPU, RAM, Network, Disk, etc.), it can be done using JMeter PerfMon Plugin. If you detect the lack of resources you will need to find another machine and go for Distributed Testing
You can consider Concurrency Thread Group and Throughput Shaping Timer combination instead of your current setup, they can be connected via Feedback Function so JMeter will be able to kick off more threads if current amount is not enough to create the necessary load
I am trying to run jenkins job for my automation. Here I am using cucumber Bdd. While running locally in single thread, test cases are working good. But while building the job in jenkins using multiThreading, test cases are failing randomly. Once one is passed , in the successive build it is getting failed. Most of them are having the below error. It seems like there is some server issue that page is not loading in the browser while running the test cases. Can you suggest any way out to run this successfully?
My whole test cases are so large in size that if not run in multiThread it will take 6 to 7 hrs . The server is not supporting such long time. It is getting socket timeout after half of the run(after 3 hrs.)
org.openqa.selenium.TimeoutException: Course wasn't loaded after 30
seconds. Build info:
version:'2.53.1',revision:'a36b8b1cd5757287168e54b817830adce9b0158d',time:
'2016-06-30 19:26:09' System info: host: 'jenkins-50a5c8e3',
ip:'100.64.111.138',os.name:'Linux',os.arch:'amd64',os.version:'2.6.32-5-xen-amd64',java.version:'1.8.0_40'Driver
info:driver.version:unknown
This question is a bit vague so the best I can do is give a vague answer of what you might want to look into.
Make sure your tests can run in isolation You mentioned it works in a single thread. If your tests don't each have isolated data (course, user, whatever) then it's really easy to have one test do something like remove a course while another test is trying to access it if you run them in parallel.
Timing issues If you have timing issues in your tests, you probably need more robust explicit waits.
Make sure you properly dispose of your driver Preferably in a finally block. You need to make sure that no matter what path your tests take, the driver will get closed. You might want to start a strategy as well to clean up stranded driver instances, restart nodes, etc...
I have an issue with Silk Test's Open Agent (Silk Test 2011).
I am using Silk4J for acceptance tests written in Java for a C++ client. It starts the tests properly but does not stop after the tests are completed. I have to do it manually so the job is completed in Jenkins.
Silk Test 2011 with Hotfix3 is installed on my Windows 7 SP1 (64bit).
The Silk Test 2011 release notes mention turning off user access control and I have done so.
I am having a hard time isolating the problem and hope somebody may have some ideas.
Silk Test's Open Agent should not be blocking your tests from completion.
In the past I've seen similar issues by the Java VM leaking sockets to their child processes, which then occasionally causes another processes to think the JVM was still alive.
You could try
Upgrading the involved JVM(s)
Upgrading Silk Test (2011 is ancient)
Take a close look at the network sockets the various processes have open, if the first two steps don't solve your issue, this might help you find out why.
I have a Java/Database project in Netbeans that I would like to run once a day at a set time. I am using Derby for the database driver. I am trying to automate a process.
How can I 'schedule' this program to run at specified times?
How can I customize this to keep running until a certain criteria is met?
Say my criteria is that It has to populate 500 rows in the database. (So say at the scheduled time it runs it can only populate 400 rows, then maybe 2 hours later it tries running again to fill the last 100 rows)
Lastly, what are the best practices of automation and scheduled tasks?
How can I 'schedule' this program to run at specified times?
This can be done one of two ways, depending on your operating system - write a job that kicks off the java program at the intervals you need. You may then hook up the job to be started off on start up.
In Linux you can accomplish this with a cron job or so. On windows you may refer to this http://support.microsoft.com/kb/308569.
You may also program the scheduler into your java program using http://quartz-scheduler.org or http://www.sauronsoftware.it/projects/cron4j/ .
How can I customize this to keep running until a certain criteria is met?
This is perhaps best established from within your program, although it is hard to give you directions without much info.
Lastly, what are the best practices of automation and scheduled tasks?
Depending on your application architecture, scheduling and automation can be handled either from within the app or get support from the operating system. The criteria depends on how much control the application needs, which platform makes scheduling easy etc.
Hope this helps.
Quartz is a scheduling project for Java. I have used it in many projects and find it to be very intuitive.
It may be a little over the top for what your after but worth a look anyway.
You can make use of Timer for scheduling the events & the events/task must be implemented using TimerTask