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

Refactor concurrency #3623

Merged
merged 23 commits into from Sep 1, 2023
Merged

Refactor concurrency #3623

merged 23 commits into from Sep 1, 2023

Commits on Aug 17, 2023

  1. Copy the full SHA
    fc06eea View commit details
    Browse the repository at this point in the history
  2. Refactor concurrency

    * 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`.
    OliverO2 committed Aug 17, 2023
    Copy the full SHA
    4ab25ee View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    339f2ee View commit details
    Browse the repository at this point in the history
  4. Update API

    OliverO2 committed Aug 17, 2023
    Copy the full SHA
    4b9f404 View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2023

  1. Simplify replay

    OliverO2 committed Aug 18, 2023
    Copy the full SHA
    f52b807 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2023

  1. Copy the full SHA
    782f28c View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2023

  1. Copy the full SHA
    a7d63b5 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    0088f7d View commit details
    Browse the repository at this point in the history
  3. Merge branch 'master' into refactor-concurrency

    # Conflicts:
    #	kotest-extensions/kotest-extensions-blockhound/src/jvmTest/kotlin/io/kotest/extensions/blockhound/BlockHoundTest.kt
    OliverO2 committed Aug 27, 2023
    Copy the full SHA
    e11aca7 View commit details
    Browse the repository at this point in the history
  4. Fix System.out/err handling: flush streams when switching or capturing

    This avoids missing captured output.
    OliverO2 committed Aug 27, 2023
    Copy the full SHA
    51a492d View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2023

  1. Copy the full SHA
    c703210 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    4141777 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    0163ec7 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    ea49adf View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2023

  1. Copy the full SHA
    3281e9c View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    fe2a11a View commit details
    Browse the repository at this point in the history
  3. Stabilize provoked thread switching with Dispatchers.Unconfined

    Increase the minimum delay to 50 milliseconds based on observed
    behavior.
    OliverO2 committed Aug 30, 2023
    Copy the full SHA
    7ffa720 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    ee98be7 View commit details
    Browse the repository at this point in the history
  5. Update API dump

    OliverO2 committed Aug 30, 2023
    Copy the full SHA
    9bc675b View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    0e3e347 View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2023

  1. Copy the full SHA
    9b5799d View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    709d8b1 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    63c927a View commit details
    Browse the repository at this point in the history