Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow limiting number of concurrent runs #14

Open
wants to merge 1 commit into
base: release/1.1
Choose a base branch
from

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.

2 participants