I have a test plan with several thread groups, each one performing different types of requests. The whole test plan is simulating our environment.
Each thread is using a special resource to send requests to the server, this resource is being built once (with a Once Only Controller) and stored in Jmeter Variables. Jmeter Variables are not shared among threads, so if I have 10 thread groups with 10 threads each one, I have 100 resources created.
I would like to disconnect this resource once each thread finish with its work.
Teardown thread groups cannot be used as the Jmeter variables are only seen by the thread that stored it.
The specific question is: how do I know when a thread has finished its work with Groovy?