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
Refactor concurrency #3623
Merged
Merged
Refactor concurrency #3623
Commits on Aug 17, 2023
-
* Avoid the use of `runBlocking` inside coroutines. Schedule all coroutines below the test engine layer via regular dispatchers, bringing the test environment more in line with actual production environments. * Remove direct use of Java's `Executors`, delegating to kotlinx.coroutines-provided dispatchers instead. * Preserve coroutine context (which includes lots of Kotest configuration) in multithreaded test executions. * Remove hard-coded 1-day time limit for multithreaded test executions. * Change tests relying on single-threading from a coroutine model to a thread model, removing coroutine invocations (`delay`), replacing those with thread invocations (`Thread.sleep`). * Avoid leaking threads by closing dispatchers after use. * Keep the `assertionCounter` synchronized with thread-switching coroutines. * Remove `fun <K, V> concurrentHashMap(): MutableMap<K, V>`, which was not thread-safe. * Make `FixedThreadCoroutineDispatcherFactory.dispatcherAffinity` thread-safe. * Revert a change in `ConcurrentTestSuiteScheduler.schedule` by commit c316bbd, which replaced `launch` with `async` plus `joinAll`. This was functionally equivalent, but `async` was not needed, as there were no values returned, and `joinAll` was already performed by the enclosing `coroutineScope`.
-
Commits on Aug 18, 2023
Commits on Aug 26, 2023
Commits on Aug 27, 2023
-
-
Merge branch 'master' into refactor-concurrency
# Conflicts: # kotest-extensions/kotest-extensions-blockhound/src/jvmTest/kotlin/io/kotest/extensions/blockhound/BlockHoundTest.kt
-
Fix System.out/err handling: flush streams when switching or capturing
This avoids missing captured output.
Commits on Aug 28, 2023
Commits on Aug 30, 2023
-
-
-
Stabilize provoked thread switching with Dispatchers.Unconfined
Increase the minimum delay to 50 milliseconds based on observed behavior.
-
-
-
Commits on Aug 31, 2023
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.