Search code examples
performancetestingjmeterthreadgroup

How "Run Thread Groups consecutively" affects on setUp/tearDown Thread Group


I am checking correctness about behaviour of setUp/tearDown Thread Group when "Run Thread Groups consecutively" into "Test Plan" is checked and NOT checked.

Suppose that we take as example below "Test Plan" structure

enter image description here

  • Without checking "Run Thread Groups consecutively" we have

    1. Thread Groups "Iterate Over Dump" and "Iterate Over Tmp Result" are executed concurrently.
    2. setUp/tearDown Thread Group are executed each one two time respectively before and after of each Thread Group.
  • With checking "Run Thread Groups consecutively" we have

    1. Thread Groups "Iterate Over Dump" and "Iterate Over Tmp Result" are executed sequentially as shown into "Test Plan".
    2. setUp Thread Group is executed one time before "Iterate Over Dump" and tearDown Thread Group is executed one time after "Iterate Over Tmp Result".

I have causally discovered this difference using "Run Thread Groups consecutively", because I need senquential execution, but I don't find any direct description of this behaviour with setUp/tearDown.

If I suppose correctly I can remove the "If controller" that I have placed to avoid double setUp/tearDown execution. Is it correct?

Regards


Solution

  • setUp Thread Group will be executed as the first thread group but it is a normal Thread Group and will be execute number of times as defined in Number of Threads.

    The difference is that these type of threads execute before the test proceeds to the executing of regular Thread Groups.

    tearDown Thread Group will act the same except it will be executed as the last thread group.

    execute after the test has finished executing its regular Thread Groups.

    Otherwise it might be consider a bug.