jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harperdev <hcappd...@gmail.com>
Subject Re: Stop Test when Thread Group #2 Stops
Date Thu, 14 Aug 2014 23:26:10 GMT
Thanks Sebb. I ended up using a BeanShell to calculate how many total threads
would run, like this:

int numThreads = ctx.getThreadGroup().getNumberOfThreads();
Controller ctrl = ctx.getThreadGroup().getSamplerController();
LoopController loopCtrl = (LoopController)ctrl;
int numLoops= loopCtrl.getLoops();
int totalThreads = numLoops * numThreads;

I also have a simple counter, and if the counter >= totalThreads it stops
the test:
SampleResult.setStopTest(true);

Too bad it doesn't work when TG2 is set to loop "Forever". In that case TG2
automatically stops when the csv data hits eof, but TG1 keeps going since my
code above doesn't know when TG2 will stop.



--
View this message in context: http://jmeter.512774.n5.nabble.com/Stop-Test-when-Thread-Group-2-Stops-tp5720738p5720841.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Mime
View raw message