concurrentTests not being respected during ConcurrentTestLauncher [kotest 4.6.3]
See original GitHub issueDuring some experimenting with kotest, I was playing around with the parallelism
, concurrentTests
and concurrentSpecs
.
When setting the concurrentTests
to something higher than 1, it just burst and execute all the tests all at once, even if I have a delay (which could be due to being suspended) or if I have hacky stuff like doing nothing for X amount of seconds (to ensure no suspension points were available) and it still burst the number of tests being triggered all at once.
I noticed that it relies on kotlinx.coroutines.sync.Semaphore
and on Semaphore.withPermit
.
Also, what I should expect if I have 4 Specs with 12 tests each and I set the values to concurrentTests = 3
and concurrentSpecs = 2
?
As far as I understood the code, 1 coroutine should be launched for each spec and 3 coroutines should be launched for each test, totaling 6 concurrent tests running at once.
If that’s the case, seems that concurrentTest
is not super useful, since I can’t have fine tunning on how many tests I’m running all at once. I don’t whether this makes sense or not to be honest, but if I set the concurrentTests
for 10, I understand that I shouldn’t have more than 10 tests running at the same time globally.
One solution could be this also be configurable, like IsolationMode
, so I could configure concurrentTests
per Spec or Globally.
Kotest version: 4.6.3 Java version: Adopt 10.0.11-hs-adpt Kotlin version: 1.5.31
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
I think there’s a coroutine scope in the loop too to stop that happening. I’ll check more and give a full reply to your posts tomorrow night when I’m back from vacation.
On Sat, 6 Nov 2021, 16:10 William Johnson S. Okano, < @.***> wrote:
Now that 5.0 is out and you’re happy with the current state, I will close this.