0

Does anyone know if its possible to add a timer within a test which only runs when a datafile reaches EOF?

i.e. multiple threads running through a test, accessing 1 data file. When the file reaches the end, before looping back to the beginning, it waits 5 minutes.

Thanks!

Mike
  • 51
  • 1
  • 6

1 Answers1

1

If you have CSV Data Set Config with "Recycle on EOF = True" there is no way to detect the "last" line of data as you will not get <EOF> value of the variable.

I can only think of adding an If Controller and use the following __groovy() function as the condition:

${__groovy(new File('/path/to/your/file.csv').readLines().size() == (vars.get('__jm__' + ctx.getThreadGroup().getName() + '__idx') as int) + 1 ,)}

Then add a Flow Control Action sampler as a child of this If Controller and configure it to wait for 5 minutes:

enter image description here

Dmitri T
  • 159,985
  • 5
  • 83
  • 133