On 24-Jan-2024, at 11:43 PM, 'Aleksandr Postnov' via testng-users <testng...@googlegroups.com> wrote:Hi folks,
We are currently using IExecutorFactory, but it is deprecated in the latest version. I wonder what we could use instead for our case.
Context: We want to run E2E tests that use heavy resources like devices. A Test Suite Run can take 20-30 minutes in total. During the run, 1-2-3 devices can stop working. In this case, we need to adjust the number of currently running threads.
What we do is: We need to dynamically adjust TestNG's thread pool size during a test run so that the thread count is in line with the number of available emulators/simulators. Increasing and decreasing the number of threads is supported by Java's ThreadPoolExecutor (via methods setCorePoolSize() and setMaximumPoolSize()), so the only thing we actually need is references to ThreadPoolExecutors.
To get the reference, we introduced a class that implements IExecutorFactory and stores references to created Executors. This class is then passed to TestNG via the -threadPoolFactoryClass parameter.
This scheme is working fine, but some parts of it were deprecated, and it looks like they may be removed at some point.
So the question is: how do we achieve the above in the new versions of TestNG?
Thanks!
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/072247cd-240b-4159-986d-2886edc22953n%40googlegroups.com.