Skip to content

use-global-thread-pool works incorrectly: threads count depends on count of DDT in code #3242

@kool79

Description

@kool79

When use-global-thread-pool == "true":

  1. I cannot limit thread count to X if my code has X data-driven tests. I have a class with 5 DDT. Suite has the next settings:
<suite name="Suite" parallel="methods" thread-count="5" data-provider-thread-count="3"
       use-global-thread-pool="true"
>

When I try to start the suite, suddenly it is blocked --
[Deadlock condition detected] Cannot run 5 data driven tests on just 5 threads when using common thread pool. Please increase the number of threads to at-least 6.

  • Even if I never use those tests (filter them) -- I cannot start the suite.
  • Whan I had 4 DDT tests in our codebase, and someone adds one additional DDT test -- our suite stopped execution on CI on a current infrastructure, which can handle max 5 threads. It is very ugly. Why our codebase (our tests) should depend on infrastructure? Why execution is stopped even if we dont run those tests? (filtered from execution with a listeners)
  1. My suite have a class with a 5 DDTs, each have a 8 data-rows (total 5*40 = cases). When I set a bigger number of thread-count:
<suite name="Suite" parallel="methods" thread-count="6" data-provider-thread-count="3"
       use-global-thread-pool="true"
>

I expect that all threads will be used for execution. Instead, I see that tests are executed in 1 thread! When I increase number of thread-count to 7, tests are invoked with 2 threads only (screenshot below) . So the actual thread count is equals to - N where N -- count of DDT in my code! So, when I push additional test onto my repo, I have degraded performance, because of lower threads

Image

DataProviderParallelTest.java

testng-shared-pool.xml

pom.xml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions