JMeter How to run two parallel thread sets consecutively - testing

I need to create a Thread Group Using JMeter with 5 Thread Groups.
This is how I want this test to run:
Thread 1 and 2 Starts Parallelly. (But Thread 1 only runs once and Thread 2 runs till it gets a success)
Once Thread 2 finishes running, Thread 3 and 4 should start running parrallaly.(But Thread 3 only runs once and Thread 4 runs till it gets a success)
Once Thread 4 finishes Thread 5 needs to start.
Really appreciate if you can guide me to achieve this task.
Thanks in Advance.

If you don't need to pass anything between the Thread Groups the easiest would be just putting all the requests under one Thread Group and control the concurrency using Parallel Controller
If you need to pass something between Thread Groups, i.e. Thread3 requires some data from Thread2 - consider using Inter-Thread Communication Plugin
Both plugins can be installed using JMeter Plugins Manager

Related

Sending an email about thread groups in JMeter

Very new to JMeter and I've just written a script that will test enquiry forms on our sites. Each site has its own thread and the test for their enquiry forms is inside the corresponding thread.
Is there a way to send 1 email after the test has completed with the status of each thread group? i.e thread group 1 passed, thread group 2 passed, thread group 3 failed, thread group 4 passed etc.. The idea is that this script will run once a week automatically and if one of the sites has an error then I'll be notified.
Thanks in advance
Currently do you create some kind of report in any format?
If yes, JMeter has a SMTP sampler which you could use it in a tear down thread group to send the report to the given email addresses.
You mentioned that you run this periodically. If you use jenkins or other CI tools, that may be configured to send the results.
This might give some idea.
http://www.testautomationguru.com/jmeter-continuous-performance-testing-part2/

Download 1 file at a time using NSUrlSession in iOS

I am downloading multiple files using NSUrlSession in my iOS app. I want to download only one file at a time. But it is downloading multiple files at 1 time. Please suggest a way to download files one at a time.
I tried this property :
sessionConfiguration.HTTPMaximumConnectionsPerHost = 1
But it also download multiple files if they are hosted on different servers.Please suggest a way to do this
You have 2 options:
sync: Daisy chain your requests from the completionHandler, triggering a new NSURLSession resume upon the completion or failure of the previous one.
async: Each operation must complete before the next one can start, and waits until completion signals using a semaphore. The thread performing the scheduling of each NSURLSession resume will wait for that operation to complete. See https://stackoverflow.com/a/21205992/218152
sync/async clarification
Neither of these options are suggesting to run your operations on the main thread: sync/async is merely referring to the background thread responsible for the scheduling.

No. of samplers showing more in listner than defined in Thread

In thread I have mentioned 2 thread means 2 users but when I run my test in listner it shows 16 Samples.
Why its behaving like this?
Please check the below attached image.
This is because you are using a Stepup thread group, which is used for Stress test. This thread group is time based so if you say hold 2 users for 5 seconds, it will keep 2 users active for that time frame irrespective of samples it has to create.
hope this will help.

No of consumers getting reduced as time is passed in Torquebox

I have a rails app which is on torquebox. I am using processors to some background jobs. I have alloted 4 workers to that processor.
queues:
/queue/company:
messaging:
/queue/company:
CompanyWorker:
concurrency: 4
The CompanyWorker is doing a call to some other sites. It may raise an exception but I have caught inside by worker itself. But as I noticed my log I have seen that no. of threads/workers are reduced as time passes. After 10-15 hours only one thread/processor is working. How do I stop this from happening and keep all 4 workers/processors alive.
After Some hours I only see
22:29:40,945 INFO [stdout] (Thread-124 (HornetQ-client-global-threads-1460048766))
only thread 124 doing its job,
And after few hours I need to restart the server to get all 4 processors working
Make sure all your processors are completing, i.e. not hanging indefinitely. Also make sure you're catching Throwable so nothing thrown escapes.

Make Thread sleep first before it runs

How can I make my thread sleep first before it runs? I know how to get sleep to work, however, whenever my program is run, the thread immediately runs. I want it to WAIT once it is first created to start running. (I am using handlers)
You cannot control when threads are scheduled. If you want it to go to sleep, have the first statement in the thread subroutine do a wait on a condition or something like that and when you are ready you can broadcast to that condition. In pseudo-code:
get-lock
if (we-are-still-supposed-to-sleep)
pthread_cond_wait()
release-lock
I suppose you could have the parent hold the lock while creating the children and then all they have to do is:
get-lock
release-lock
and avoid the condition thing.
What OS? Windoze allows you to create threads in a suspended state. When you have loaded up the thread fields in the ctor, you can resume the thread. Failing that, pass some synchro object in the thread start parameter for the new thread to wait on.
Rgds,
Martin.