Use case
In many cases, test elements need "per-thread-group-scope" variable or "per-test-execution-scope" variable.
For instance:
- Timers use
static final Map<ThreadGroup, timerState>
- Summarizers might need their state as well
- DB connection pool might need to pool connections
The current approach of element implements TestStateListener causes issues like #6174, #6165
Possible solution
We might need something like https://docs.gradle.org/current/userguide/build_services.html or https://github.com/google/guice/wiki/Scopes so the plugin authors can explicitly declare "per-test-execution state objects", so they do not need to implement TestStateListener in the test elements.
It might be worth deprecatign TestElement implements TestStateListener at least to discourage that usage pattern.
Possible workarounds
No response
JMeter Version
5.6.2
Java Version
No response
OS Version
No response