Skip to content

Conversation

@KazankovMarch
Copy link

@KazankovMarch KazankovMarch commented Aug 5, 2023

Running all test classes and methods at once consumes a lot of CPU/RAM/network, that might cause problems on weak machines with large amount of tests

We need both semaphores I added because

  1. classRunsSemaphore doesn't limit method runs (there may be a lot of test methods within single test class)
  2. methodsRunsSemaphore doesn't limit beforeAll and afterAll methods which can consume resources as well

Running all test classes and methods at once consumes a lot of CPU/RAM/network, that might cause problems on weak machines with large amount of tests
suspend fun Semaphore?.withPermitIfNotNull(block: suspend () -> Unit) = if(this != null) {
withPermit { block() }
} else {
block()
Copy link
Author

@KazankovMarch KazankovMarch Aug 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code is needed to avoid any overhead for those who don't want to set up the limits.

But MAYBE we should add some limits by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants