I have to do some setup and cleanup on the database I am load testing with Jmeter and Jun开发者_如何学运维it. I have put these in setUp and tearDown respectively. My question now is what happens when I fire off 100 threads that execute my test? Will Jmeter first run 100 setUp's, then 100 threads of my test and then 100 tearDowns? Or does it just create 100 threads to execute my test and run them all in parallel?
My concern is just that the setUp and tearDown may affect my testing, depending on how Jmeter and Junit do things. In that case, I would have to do setUp and tearDown completely outside of my test.
I haven't used Junit and Jmeter together, so I'm assuming setUp and tearDown are part of Junit.
Given that, I would assume Junit would execute setUp, run the Jmeter script then run tearDown when Jmeter signals it is done. Since JMeter uses the same script for multiple threads, and isn't "done" until the last thread finishes, you shouldn't have multiple setUp/teardown Scripts.
I would try it with 2 threads and see what happens.
The time to perform the setUp and tearDown isn’t taken into account when calculating the sampler’s elapsed time. Only the execution time of the test method itself is measured - so from a reporting point of view it doesn’t make any difference
精彩评论