Skip to content

Commit

Permalink
fix(deps): bump kotlinCoroutinesVersion from 1.5.2 to 1.6.2 and kotli…
Browse files Browse the repository at this point in the history
…n to 1.6.21 (#235)

Bumps `kotlinCoroutinesVersion` from 1.5.2 to 1.6.2.
Updates `kotlinx-coroutines-core` from 1.5.2 to 1.6.2
Bumps Kotlin to  1.6.21
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/Kotlin/kotlinx.coroutines/releases">kotlinx-coroutines-core's releases</a>.</em></p>
<blockquote>
<h2>1.6.2</h2>
<ul>
<li>Fixed a bug with <code>ThreadLocalElement</code> not being correctly updated when the most outer <code>suspend</code> function was called directly without <code>kotlinx.coroutines</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2930">#2930</a>).</li>
<li>Fixed multiple data races: one that might have been affecting <code>runBlocking</code> event loop, and a benign data race in <code>Mutex</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3250">#3250</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3251">#3251</a>).</li>
<li>Obsolete <code>TestCoroutineContext</code> is removed, which fixes the <code>kotlinx-coroutines-test</code> JPMS package being split between <code>kotlinx-coroutines-core</code> and <code>kotlinx-coroutines-test</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3218">#3218</a>).</li>
<li>Updated the ProGuard rules to further shrink the size of the resulting DEX file with coroutines (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3111">#3111</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3263">#3263</a>). Thanks, <a href="https://github.com/agrieve"><code>@​agrieve</code></a>!</li>
<li>Atomicfu is updated to <code>0.17.2</code>, which includes a more efficient and robust JS IR transformer (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3255">#3255</a>).</li>
<li>Kotlin is updated to <code>1.6.21</code>, Gradle version is updated to <code>7.4.2</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3281">#3281</a>). Thanks, <a href="https://github.com/wojtek-kalicinski"><code>@​wojtek-kalicinski</code></a>!</li>
<li>Various documentation improvements.</li>
</ul>
<h2>1.6.1</h2>
<ul>
<li>Rollback of time-related functions dispatching on <code>Dispatchers.Main</code>.
This behavior was introduced in 1.6.0 and then found inconvenient and erroneous (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3106">#3106</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3113">#3113</a>).</li>
<li>Reworked the newly-introduced <code>CopyableThreadContextElement</code> to solve issues uncovered after the initial release (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3227">#3227</a>).</li>
<li>Fixed a bug with <code>ThreadLocalElement</code> not being properly updated in racy scenarios (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2930">#2930</a>).</li>
<li>Reverted eager loading of default <code>CoroutineExceptionHandler</code> that triggered ANR on some devices (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3180">#3180</a>).</li>
<li>New API to convert a <code>CoroutineDispatcher</code> to a Rx scheduler (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/968">#968</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/548">#548</a>). Thanks <a href="https://github.com/recheej"><code>@​recheej</code></a>!</li>
<li>Fixed a memory leak with the very last element emitted from <code>flow</code> builder being retained in memory (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3197">#3197</a>).</li>
<li>Fixed a bug with <code>limitedParallelism</code> on K/N with new memory model throwing <code>ClassCastException</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3223">#3223</a>).</li>
<li><code>CoroutineContext</code> is added to the exception printed to the default <code>CoroutineExceptionHandler</code> to improve debuggability (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3153">#3153</a>).</li>
<li>Static memory consumption of <code>Dispatchers.Default</code> was significantly reduced (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3137">#3137</a>).</li>
<li>Updated slf4j version in <code>kotlinx-coroutines-slf4j</code> from 1.7.25 to 1.7.32.</li>
</ul>
<h2>1.6.0</h2>
<p>Note that this is a full changelog relative to the 1.5.2 version. Changelog relative to 1.6.0-RC3 can be found at the end.</p>
<h3>kotlinx-coroutines-test rework</h3>
<ul>
<li><code>kotlinx-coroutines-test</code> became a multiplatform library usable from K/JVM, K/JS, and K/N.</li>
<li>Its API was completely reworked to address long-standing issues with consistency, structured concurrency and correctness (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1203">#1203</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1609">#1609</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2379">#2379</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1749">#1749</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1204">#1204</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1390">#1390</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1222">#1222</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1395">#1395</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1881">#1881</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1910">#1910</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1772">#1772</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1626">#1626</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1742">#1742</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2082">#2082</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2102">#2102</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2405">#2405</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2462">#2462</a>
).</li>
<li>The old API is deprecated for removal, but the new API is based on the similar concepts (<a href="https://github.com/Kotlin/kotlinx.coroutines/blob/HEAD/kotlinx-coroutines-test/README.md">README</a>), and the migration path is designed to be graceful: <a href="https://github.com/Kotlin/kotlinx.coroutines/blob/HEAD/kotlinx-coroutines-test/MIGRATION.md">migration guide</a>.</li>
</ul>
<h3>Dispatchers</h3>
<ul>
<li>Introduced <code>CoroutineDispatcher.limitedParallelism</code> that allows obtaining a view of the original dispatcher with limited parallelism (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2919">#2919</a>).</li>
<li><code>Dispatchers.IO.limitedParallelism</code> usages ignore the bound on the parallelism level of <code>Dispatchers.IO</code> itself to avoid starvation (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2943">#2943</a>).</li>
<li>Introduced new <code>Dispatchers.shutdown</code> method for containerized environments (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2558">#2558</a>).</li>
<li><code>newSingleThreadContext</code> and <code>newFixedThreadPoolContext</code> are promoted to delicate API (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2919">#2919</a>).</li>
</ul>
<h3>Breaking changes</h3>
<ul>
<li>When racing with cancellation, the <code>future</code> builder no longer reports unhandled exceptions into the global <code>CoroutineExceptionHandler</code>. Thanks <a href="https://github.com/vadimsemenov"><code>@​vadimsemenov</code></a>! (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2774">#2774</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2791">#2791</a>).</li>
<li><code>Mutex.onLock</code> is deprecated for removal (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2794">#2794</a>).</li>
<li><code>Dispatchers.Main</code> is now used as the default source of time for <code>delay</code> and <code>withTimeout</code> when present (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2972">#2972</a>).
<ul>
<li>To opt-out from this behaviour, <code>kotlinx.coroutines.main.delay</code> system property can be set to <code>false</code>.</li>
</ul>
</li>
<li>Java target of coroutines build is now 8 instead of 6 (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1589">#1589</a>).</li>
<li><strong>Source-breaking change</strong>: extension <code>collect</code> no longer resolves when used with a non-in-place argument of a functional type. This is a candidate for a fix, uncovered after 1.6.0, see <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3107">#3107</a> for the additional details.</li>
</ul>
<h3>Bug fixes and improvements</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md">kotlinx-coroutines-core's changelog</a>.</em></p>
<blockquote>
<h2>Version 1.6.2</h2>
<ul>
<li>Fixed a bug with <code>ThreadLocalElement</code> not being correctly updated when the most outer <code>suspend</code> function was called directly without <code>kotlinx.coroutines</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2930">#2930</a>).</li>
<li>Fixed multiple data races: one that might have been affecting <code>runBlocking</code> event loop, and a benign data race in <code>Mutex</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3250">#3250</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3251">#3251</a>).</li>
<li>Obsolete <code>TestCoroutineContext</code> is removed, which fixes the <code>kotlinx-coroutines-test</code> JPMS package being split between <code>kotlinx-coroutines-core</code> and <code>kotlinx-coroutines-test</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3218">#3218</a>).</li>
<li>Updated the ProGuard rules to further shrink the size of the resulting DEX file with coroutines (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3111">#3111</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3263">#3263</a>). Thanks, <a href="https://github.com/agrieve"><code>@​agrieve</code></a>!</li>
<li>Atomicfu is updated to <code>0.17.2</code>, which includes a more efficient and robust JS IR transformer (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3255">#3255</a>).</li>
<li>Kotlin is updated to <code>1.6.21</code>, Gradle version is updated to <code>7.4.2</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3281">#3281</a>). Thanks, <a href="https://github.com/wojtek-kalicinski"><code>@​wojtek-kalicinski</code></a>!</li>
<li>Various documentation improvements.</li>
</ul>
<h2>Version 1.6.1</h2>
<ul>
<li>Rollback of time-related functions dispatching on <code>Dispatchers.Main</code>.
This behavior was introduced in 1.6.0 and then found inconvenient and erroneous (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3106">#3106</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3113">#3113</a>).</li>
<li>Reworked the newly-introduced <code>CopyableThreadContextElement</code> to solve issues uncovered after the initial release (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3227">#3227</a>).</li>
<li>Fixed a bug with <code>ThreadLocalElement</code> not being properly updated in racy scenarios (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2930">#2930</a>).</li>
<li>Reverted eager loading of default <code>CoroutineExceptionHandler</code> that triggered ANR on some devices (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3180">#3180</a>).</li>
<li>New API to convert a <code>CoroutineDispatcher</code> to a Rx scheduler (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/968">#968</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/548">#548</a>). Thanks <a href="https://github.com/recheej"><code>@​recheej</code></a>!</li>
<li>Fixed a memory leak with the very last element emitted from <code>flow</code> builder being retained in memory (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3197">#3197</a>).</li>
<li>Fixed a bug with <code>limitedParallelism</code> on K/N with new memory model throwing <code>ClassCastException</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3223">#3223</a>).</li>
<li><code>CoroutineContext</code> is added to the exception printed to the default <code>CoroutineExceptionHandler</code> to improve debuggability (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3153">#3153</a>).</li>
<li>Static memory consumption of <code>Dispatchers.Default</code> was significantly reduced (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3137">#3137</a>).</li>
<li>Updated slf4j version in <code>kotlinx-coroutines-slf4j</code> from 1.7.25 to 1.7.32.</li>
</ul>
<h2>Version 1.6.0</h2>
<p>Note that this is a full changelog relative to the 1.5.2 version. Changelog relative to 1.6.0-RC3 can be found at the end.</p>
<h3>kotlinx-coroutines-test rework</h3>
<ul>
<li><code>kotlinx-coroutines-test</code> became a multiplatform library usable from K/JVM, K/JS, and K/N.</li>
<li>Its API was completely reworked to address long-standing issues with consistency, structured concurrency and correctness (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1203">#1203</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1609">#1609</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2379">#2379</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1749">#1749</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1204">#1204</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1390">#1390</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1222">#1222</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1395">#1395</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1881">#1881</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1910">#1910</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1772">#1772</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1626">#1626</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1742">#1742</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2082">#2082</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2102">#2102</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2405">#2405</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2462">#2462</a>
).</li>
<li>The old API is deprecated for removal, but the new API is based on the similar concepts (<a href="https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-test/README.md">README</a>), and the migration path is designed to be graceful: <a href="https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-test/MIGRATION.md">migration guide</a>.</li>
</ul>
<h3>Dispatchers</h3>
<ul>
<li>Introduced <code>CoroutineDispatcher.limitedParallelism</code> that allows obtaining a view of the original dispatcher with limited parallelism (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2919">#2919</a>).</li>
<li><code>Dispatchers.IO.limitedParallelism</code> usages ignore the bound on the parallelism level of <code>Dispatchers.IO</code> itself to avoid starvation (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2943">#2943</a>).</li>
<li>Introduced new <code>Dispatchers.shutdown</code> method for containerized environments (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2558">#2558</a>).</li>
<li><code>newSingleThreadContext</code> and <code>newFixedThreadPoolContext</code> are promoted to delicate API (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2919">#2919</a>).</li>
</ul>
<h3>Breaking changes</h3>
<ul>
<li>When racing with cancellation, the <code>future</code> builder no longer reports unhandled exceptions into the global <code>CoroutineExceptionHandler</code>. Thanks <a href="https://github.com/vadimsemenov"><code>@​vadimsemenov</code></a>! (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2774">#2774</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2791">#2791</a>).</li>
<li><code>Mutex.onLock</code> is deprecated for removal (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2794">#2794</a>).</li>
<li><code>Dispatchers.Main</code> is now used as the default source of time for <code>delay</code> and <code>withTimeout</code> when present(<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2972">#2972</a>).
<ul>
<li>To opt-out from this behaviour, <code>kotlinx.coroutines.main.delay</code> system property can be set to <code>false</code>.</li>
</ul>
</li>
<li>Java target of coroutines build is now 8 instead of 6 (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1589">#1589</a>).</li>
<li><strong>Source-breaking change</strong>: extension <code>collect</code> no longer resolves when used with a non-in-place argument of a functional type. This is a candidate for a fix, uncovered after 1.6.0, see <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3107">#3107</a> for the additional details.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/d737da6f109784b67977af579fe3274c250857c9"><code>d737da6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3304">#3304</a> from Kotlin/version-1.6.2</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/eb9dd554df5d069f68af741988427168a8428abe"><code>eb9dd55</code></a> Version 1.6.2</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/2f6f6f60429929169d8ee7518989bfa3a9140385"><code>2f6f6f6</code></a> Merge branch 'master' into develop</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/9ea4fea065613cbebf04dc09a64186450831805a"><code>9ea4fea</code></a> Mention swallowing CancellationExceptions in the docs (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3302">#3302</a>)</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/c38ecb67dab68d9c27e7ba9514112949f60f1ece"><code>c38ecb6</code></a> Update README.md (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3303">#3303</a>)</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/937f430ff564abc408e50f997caf8b0051878230"><code>937f430</code></a> Tweak timeout for another Windows test</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/c5b5c660830489d6bd6f426de3b78b79fcdae41d"><code>c5b5c66</code></a> Give a bigger opportunity window for cancellation in our flaky tests (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3301">#3301</a>)</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/59488d1d4c7b8a61170f2275ba78db10d575cd5b"><code>59488d1</code></a> Remove TestCoroutineContext.kt completely (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3291">#3291</a>)</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/8cdb4d6f232dfcb563abfab42a1d3ca1de9f8624"><code>8cdb4d6</code></a> Fix potential data race in EventLoop (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3289">#3289</a>)</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/20d47b7bf5e70a548fb982948998c5c616cddbbb"><code>20d47b7</code></a> Update binary-compatibility-validator (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3294">#3294</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/Kotlin/kotlinx.coroutines/compare/1.5.2...1.6.2">compare view</a></li>
</ul>
</details>
<br />

Updates `kotlinx-coroutines-test` from 1.5.2 to 1.6.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/Kotlin/kotlinx.coroutines/releases">kotlinx-coroutines-test's releases</a>.</em></p>
<blockquote>
<h2>1.6.2</h2>
<ul>
<li>Fixed a bug with <code>ThreadLocalElement</code> not being correctly updated when the most outer <code>suspend</code> function was called directly without <code>kotlinx.coroutines</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2930">#2930</a>).</li>
<li>Fixed multiple data races: one that might have been affecting <code>runBlocking</code> event loop, and a benign data race in <code>Mutex</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3250">#3250</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3251">#3251</a>).</li>
<li>Obsolete <code>TestCoroutineContext</code> is removed, which fixes the <code>kotlinx-coroutines-test</code> JPMS package being split between <code>kotlinx-coroutines-core</code> and <code>kotlinx-coroutines-test</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3218">#3218</a>).</li>
<li>Updated the ProGuard rules to further shrink the size of the resulting DEX file with coroutines (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3111">#3111</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3263">#3263</a>). Thanks, <a href="https://github.com/agrieve"><code>@​agrieve</code></a>!</li>
<li>Atomicfu is updated to <code>0.17.2</code>, which includes a more efficient and robust JS IR transformer (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3255">#3255</a>).</li>
<li>Kotlin is updated to <code>1.6.21</code>, Gradle version is updated to <code>7.4.2</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3281">#3281</a>). Thanks, <a href="https://github.com/wojtek-kalicinski"><code>@​wojtek-kalicinski</code></a>!</li>
<li>Various documentation improvements.</li>
</ul>
<h2>1.6.1</h2>
<ul>
<li>Rollback of time-related functions dispatching on <code>Dispatchers.Main</code>.
This behavior was introduced in 1.6.0 and then found inconvenient and erroneous (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3106">#3106</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3113">#3113</a>).</li>
<li>Reworked the newly-introduced <code>CopyableThreadContextElement</code> to solve issues uncovered after the initial release (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3227">#3227</a>).</li>
<li>Fixed a bug with <code>ThreadLocalElement</code> not being properly updated in racy scenarios (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2930">#2930</a>).</li>
<li>Reverted eager loading of default <code>CoroutineExceptionHandler</code> that triggered ANR on some devices (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3180">#3180</a>).</li>
<li>New API to convert a <code>CoroutineDispatcher</code> to a Rx scheduler (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/968">#968</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/548">#548</a>). Thanks <a href="https://github.com/recheej"><code>@​recheej</code></a>!</li>
<li>Fixed a memory leak with the very last element emitted from <code>flow</code> builder being retained in memory (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3197">#3197</a>).</li>
<li>Fixed a bug with <code>limitedParallelism</code> on K/N with new memory model throwing <code>ClassCastException</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3223">#3223</a>).</li>
<li><code>CoroutineContext</code> is added to the exception printed to the default <code>CoroutineExceptionHandler</code> to improve debuggability (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3153">#3153</a>).</li>
<li>Static memory consumption of <code>Dispatchers.Default</code> was significantly reduced (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3137">#3137</a>).</li>
<li>Updated slf4j version in <code>kotlinx-coroutines-slf4j</code> from 1.7.25 to 1.7.32.</li>
</ul>
<h2>1.6.0</h2>
<p>Note that this is a full changelog relative to the 1.5.2 version. Changelog relative to 1.6.0-RC3 can be found at the end.</p>
<h3>kotlinx-coroutines-test rework</h3>
<ul>
<li><code>kotlinx-coroutines-test</code> became a multiplatform library usable from K/JVM, K/JS, and K/N.</li>
<li>Its API was completely reworked to address long-standing issues with consistency, structured concurrency and correctness (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1203">#1203</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1609">#1609</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2379">#2379</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1749">#1749</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1204">#1204</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1390">#1390</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1222">#1222</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1395">#1395</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1881">#1881</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1910">#1910</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1772">#1772</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1626">#1626</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1742">#1742</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2082">#2082</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2102">#2102</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2405">#2405</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2462">#2462</a>
).</li>
<li>The old API is deprecated for removal, but the new API is based on the similar concepts (<a href="https://github.com/Kotlin/kotlinx.coroutines/blob/HEAD/kotlinx-coroutines-test/README.md">README</a>), and the migration path is designed to be graceful: <a href="https://github.com/Kotlin/kotlinx.coroutines/blob/HEAD/kotlinx-coroutines-test/MIGRATION.md">migration guide</a>.</li>
</ul>
<h3>Dispatchers</h3>
<ul>
<li>Introduced <code>CoroutineDispatcher.limitedParallelism</code> that allows obtaining a view of the original dispatcher with limited parallelism (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2919">#2919</a>).</li>
<li><code>Dispatchers.IO.limitedParallelism</code> usages ignore the bound on the parallelism level of <code>Dispatchers.IO</code> itself to avoid starvation (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2943">#2943</a>).</li>
<li>Introduced new <code>Dispatchers.shutdown</code> method for containerized environments (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2558">#2558</a>).</li>
<li><code>newSingleThreadContext</code> and <code>newFixedThreadPoolContext</code> are promoted to delicate API (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2919">#2919</a>).</li>
</ul>
<h3>Breaking changes</h3>
<ul>
<li>When racing with cancellation, the <code>future</code> builder no longer reports unhandled exceptions into the global <code>CoroutineExceptionHandler</code>. Thanks <a href="https://github.com/vadimsemenov"><code>@​vadimsemenov</code></a>! (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2774">#2774</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2791">#2791</a>).</li>
<li><code>Mutex.onLock</code> is deprecated for removal (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2794">#2794</a>).</li>
<li><code>Dispatchers.Main</code> is now used as the default source of time for <code>delay</code> and <code>withTimeout</code> when present (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2972">#2972</a>).
<ul>
<li>To opt-out from this behaviour, <code>kotlinx.coroutines.main.delay</code> system property can be set to <code>false</code>.</li>
</ul>
</li>
<li>Java target of coroutines build is now 8 instead of 6 (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1589">#1589</a>).</li>
<li><strong>Source-breaking change</strong>: extension <code>collect</code> no longer resolves when used with a non-in-place argument of a functional type. This is a candidate for a fix, uncovered after 1.6.0, see <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3107">#3107</a> for the additional details.</li>
</ul>
<h3>Bug fixes and improvements</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md">kotlinx-coroutines-test's changelog</a>.</em></p>
<blockquote>
<h2>Version 1.6.2</h2>
<ul>
<li>Fixed a bug with <code>ThreadLocalElement</code> not being correctly updated when the most outer <code>suspend</code> function was called directly without <code>kotlinx.coroutines</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2930">#2930</a>).</li>
<li>Fixed multiple data races: one that might have been affecting <code>runBlocking</code> event loop, and a benign data race in <code>Mutex</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3250">#3250</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3251">#3251</a>).</li>
<li>Obsolete <code>TestCoroutineContext</code> is removed, which fixes the <code>kotlinx-coroutines-test</code> JPMS package being split between <code>kotlinx-coroutines-core</code> and <code>kotlinx-coroutines-test</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3218">#3218</a>).</li>
<li>Updated the ProGuard rules to further shrink the size of the resulting DEX file with coroutines (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3111">#3111</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3263">#3263</a>). Thanks, <a href="https://github.com/agrieve"><code>@​agrieve</code></a>!</li>
<li>Atomicfu is updated to <code>0.17.2</code>, which includes a more efficient and robust JS IR transformer (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3255">#3255</a>).</li>
<li>Kotlin is updated to <code>1.6.21</code>, Gradle version is updated to <code>7.4.2</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3281">#3281</a>). Thanks, <a href="https://github.com/wojtek-kalicinski"><code>@​wojtek-kalicinski</code></a>!</li>
<li>Various documentation improvements.</li>
</ul>
<h2>Version 1.6.1</h2>
<ul>
<li>Rollback of time-related functions dispatching on <code>Dispatchers.Main</code>.
This behavior was introduced in 1.6.0 and then found inconvenient and erroneous (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3106">#3106</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3113">#3113</a>).</li>
<li>Reworked the newly-introduced <code>CopyableThreadContextElement</code> to solve issues uncovered after the initial release (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3227">#3227</a>).</li>
<li>Fixed a bug with <code>ThreadLocalElement</code> not being properly updated in racy scenarios (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2930">#2930</a>).</li>
<li>Reverted eager loading of default <code>CoroutineExceptionHandler</code> that triggered ANR on some devices (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3180">#3180</a>).</li>
<li>New API to convert a <code>CoroutineDispatcher</code> to a Rx scheduler (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/968">#968</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/548">#548</a>). Thanks <a href="https://github.com/recheej"><code>@​recheej</code></a>!</li>
<li>Fixed a memory leak with the very last element emitted from <code>flow</code> builder being retained in memory (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3197">#3197</a>).</li>
<li>Fixed a bug with <code>limitedParallelism</code> on K/N with new memory model throwing <code>ClassCastException</code> (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3223">#3223</a>).</li>
<li><code>CoroutineContext</code> is added to the exception printed to the default <code>CoroutineExceptionHandler</code> to improve debuggability (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3153">#3153</a>).</li>
<li>Static memory consumption of <code>Dispatchers.Default</code> was significantly reduced (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3137">#3137</a>).</li>
<li>Updated slf4j version in <code>kotlinx-coroutines-slf4j</code> from 1.7.25 to 1.7.32.</li>
</ul>
<h2>Version 1.6.0</h2>
<p>Note that this is a full changelog relative to the 1.5.2 version. Changelog relative to 1.6.0-RC3 can be found at the end.</p>
<h3>kotlinx-coroutines-test rework</h3>
<ul>
<li><code>kotlinx-coroutines-test</code> became a multiplatform library usable from K/JVM, K/JS, and K/N.</li>
<li>Its API was completely reworked to address long-standing issues with consistency, structured concurrency and correctness (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1203">#1203</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1609">#1609</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2379">#2379</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1749">#1749</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1204">#1204</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1390">#1390</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1222">#1222</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1395">#1395</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1881">#1881</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1910">#1910</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1772">#1772</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1626">#1626</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1742">#1742</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2082">#2082</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2102">#2102</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2405">#2405</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2462">#2462</a>
).</li>
<li>The old API is deprecated for removal, but the new API is based on the similar concepts (<a href="https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-test/README.md">README</a>), and the migration path is designed to be graceful: <a href="https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-test/MIGRATION.md">migration guide</a>.</li>
</ul>
<h3>Dispatchers</h3>
<ul>
<li>Introduced <code>CoroutineDispatcher.limitedParallelism</code> that allows obtaining a view of the original dispatcher with limited parallelism (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2919">#2919</a>).</li>
<li><code>Dispatchers.IO.limitedParallelism</code> usages ignore the bound on the parallelism level of <code>Dispatchers.IO</code> itself to avoid starvation (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2943">#2943</a>).</li>
<li>Introduced new <code>Dispatchers.shutdown</code> method for containerized environments (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2558">#2558</a>).</li>
<li><code>newSingleThreadContext</code> and <code>newFixedThreadPoolContext</code> are promoted to delicate API (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2919">#2919</a>).</li>
</ul>
<h3>Breaking changes</h3>
<ul>
<li>When racing with cancellation, the <code>future</code> builder no longer reports unhandled exceptions into the global <code>CoroutineExceptionHandler</code>. Thanks <a href="https://github.com/vadimsemenov"><code>@​vadimsemenov</code></a>! (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2774">#2774</a>, <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2791">#2791</a>).</li>
<li><code>Mutex.onLock</code> is deprecated for removal (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2794">#2794</a>).</li>
<li><code>Dispatchers.Main</code> is now used as the default source of time for <code>delay</code> and <code>withTimeout</code> when present(<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/2972">#2972</a>).
<ul>
<li>To opt-out from this behaviour, <code>kotlinx.coroutines.main.delay</code> system property can be set to <code>false</code>.</li>
</ul>
</li>
<li>Java target of coroutines build is now 8 instead of 6 (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/1589">#1589</a>).</li>
<li><strong>Source-breaking change</strong>: extension <code>collect</code> no longer resolves when used with a non-in-place argument of a functional type. This is a candidate for a fix, uncovered after 1.6.0, see <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3107">#3107</a> for the additional details.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/d737da6f109784b67977af579fe3274c250857c9"><code>d737da6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3304">#3304</a> from Kotlin/version-1.6.2</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/eb9dd554df5d069f68af741988427168a8428abe"><code>eb9dd55</code></a> Version 1.6.2</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/2f6f6f60429929169d8ee7518989bfa3a9140385"><code>2f6f6f6</code></a> Merge branch 'master' into develop</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/9ea4fea065613cbebf04dc09a64186450831805a"><code>9ea4fea</code></a> Mention swallowing CancellationExceptions in the docs (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3302">#3302</a>)</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/c38ecb67dab68d9c27e7ba9514112949f60f1ece"><code>c38ecb6</code></a> Update README.md (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3303">#3303</a>)</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/937f430ff564abc408e50f997caf8b0051878230"><code>937f430</code></a> Tweak timeout for another Windows test</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/c5b5c660830489d6bd6f426de3b78b79fcdae41d"><code>c5b5c66</code></a> Give a bigger opportunity window for cancellation in our flaky tests (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3301">#3301</a>)</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/59488d1d4c7b8a61170f2275ba78db10d575cd5b"><code>59488d1</code></a> Remove TestCoroutineContext.kt completely (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3291">#3291</a>)</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/8cdb4d6f232dfcb563abfab42a1d3ca1de9f8624"><code>8cdb4d6</code></a> Fix potential data race in EventLoop (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3289">#3289</a>)</li>
<li><a href="https://github.com/Kotlin/kotlinx.coroutines/commit/20d47b7bf5e70a548fb982948998c5c616cddbbb"><code>20d47b7</code></a> Update binary-compatibility-validator (<a href="https://github-redirect.dependabot.com/Kotlin/kotlinx.coroutines/issues/3294">#3294</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/Kotlin/kotlinx.coroutines/compare/1.5.2...1.6.2">compare view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
  • Loading branch information
dependabot[bot] authored Jun 15, 2022
1 parent ba23bdb commit 0661c7b
Show file tree
Hide file tree
Showing 15 changed files with 273 additions and 246 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
buildscript {
ext {
kotlinVersion = '1.5.31'
kotlinCoroutinesVersion = '1.5.2'
kotlinVersion = '1.6.21'
kotlinCoroutinesVersion = '1.6.2'
}
repositories {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ plugins {
apply from: 'jacoco.gradle'

android {
compileSdkVersion 31
compileSdkVersion 32
buildToolsVersion "30.0.3"

defaultConfig {
minSdkVersion 21
targetSdkVersion 31
targetSdkVersion 32
versionCode 1
versionName "1.0.0"

Expand Down
8 changes: 4 additions & 4 deletions lib/jacoco.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'jacoco'

jacoco {
toolVersion = "0.8.7"
toolVersion = "0.8.8"
}

def jacocoConfig = {
Expand Down Expand Up @@ -38,9 +38,9 @@ task jacocoTestReport(type: JacocoReport) {
configure jacocoConfig

reports {
xml.enabled = true
html.enabled = true
html.destination = file("$buildDir/reports/coverage")
xml.required.set(true)
html.required.set(true)
html.outputLocation.set(file("$buildDir/reports/coverage"))
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package tech.relaycorp.awaladroid

import java.io.File
import kotlinx.coroutines.test.runBlockingTest
import kotlinx.coroutines.test.runTest
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
Expand All @@ -14,7 +14,7 @@ import tech.relaycorp.relaynet.testing.pki.PDACertPath
@RunWith(RobolectricTestRunner::class)
public class AndroidPrivateKeyStoreTest {
@Test
public fun saveAndRetrieve(): Unit = runBlockingTest {
public fun saveAndRetrieve(): Unit = runTest {
val androidContext = RuntimeEnvironment.getApplication()
val root = FileKeystoreRoot(File(androidContext.filesDir, "tmp-keystore"))
val store = AndroidPrivateKeyStore(root, androidContext)
Expand Down
13 changes: 7 additions & 6 deletions lib/src/test/java/tech/relaycorp/awaladroid/AwalaTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import java.io.File
import java.time.Duration
import java.time.ZonedDateTime
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.test.runBlockingTest
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.runTest
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
Expand Down Expand Up @@ -38,14 +39,14 @@ public class AwalaTest {
}

@Test
public fun useAfterSetup(): Unit = runBlockingTest {
public fun useAfterSetup(): Unit = runTest {
Awala.setUp(RuntimeEnvironment.getApplication())

Awala.getContextOrThrow()
}

@Test
public fun keystores(): Unit = runBlockingTest {
public fun keystores(): Unit = runTest {
val androidContext = RuntimeEnvironment.getApplication()
Awala.setUp(androidContext)

Expand All @@ -70,7 +71,7 @@ public class AwalaTest {
}

@Test
public fun channelManager(): Unit = runBlockingTest {
public fun channelManager(): Unit = runTest {
val androidContextSpy = spy(RuntimeEnvironment.getApplication())
Awala.setUp(androidContextSpy)

Expand All @@ -83,7 +84,7 @@ public class AwalaTest {
}

@Test
public fun deleteExpiredOnSetUp(): Unit = runBlockingTest {
public fun deleteExpiredOnSetUp(): Unit = runTest {
val androidContext = RuntimeEnvironment.getApplication()
Awala.setUp(androidContext)
val originalAwalaContext = Awala.getContextOrThrow()
Expand Down Expand Up @@ -114,7 +115,7 @@ public class AwalaTest {
certificateStore.retrieveLatest(
KeyPairSet.PRIVATE_ENDPOINT.public.privateAddress,
KeyPairSet.PRIVATE_GW.private.privateAddress
) ?: return@runBlockingTest
) ?: return@runTest
}
throw AssertionError("Expired certificate not deleted")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import com.nhaarman.mockitokotlin2.times
import com.nhaarman.mockitokotlin2.verify
import com.nhaarman.mockitokotlin2.whenever
import java.time.ZonedDateTime
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.toCollection
import kotlinx.coroutines.launch
import kotlinx.coroutines.test.TestCoroutineScope
import kotlinx.coroutines.test.runBlockingTest
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.UnconfinedTestDispatcher
import kotlinx.coroutines.test.runTest
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
Expand Down Expand Up @@ -43,7 +45,7 @@ import tech.relaycorp.relaynet.testing.pki.PDACertPath
internal class GatewayClientImplTest : MockContextTestCase() {

private lateinit var pdcClient: MockPDCClient
private val coroutineScope = TestCoroutineScope()
private val coroutineScope = TestScope()
private val serviceInteractor = mock<ServiceInteractor>()
private val sendMessage = mock<SendMessage>()
private val receiveMessages = mock<ReceiveMessages>()
Expand All @@ -56,7 +58,7 @@ internal class GatewayClientImplTest : MockContextTestCase() {
// Binding

@Test
fun bind_successful() = coroutineScope.runBlockingTest {
fun bind_successful() = coroutineScope.runTest {
gatewayClient.bind()

verify(serviceInteractor).bind(
Expand All @@ -67,7 +69,7 @@ internal class GatewayClientImplTest : MockContextTestCase() {
}

@Test
fun secondBindIsSkipped() = coroutineScope.runBlockingTest {
fun secondBindIsSkipped() = coroutineScope.runTest {
gatewayClient.bind()
gatewayClient.bind()

Expand All @@ -76,7 +78,7 @@ internal class GatewayClientImplTest : MockContextTestCase() {
}

@Test
fun reBind_successful() = coroutineScope.runBlockingTest {
fun reBind_successful() = coroutineScope.runTest {
gatewayClient.bind()
gatewayClient.unbind()
gatewayClient.bind()
Expand All @@ -86,7 +88,7 @@ internal class GatewayClientImplTest : MockContextTestCase() {
}

@Test(expected = GatewayBindingException::class)
fun bind_unsuccessful() = coroutineScope.runBlockingTest {
fun bind_unsuccessful() = coroutineScope.runTest {
whenever(serviceInteractor.bind(any(), any(), any()))
.thenThrow(ServiceInteractor.BindFailedException(""))

Expand All @@ -96,7 +98,7 @@ internal class GatewayClientImplTest : MockContextTestCase() {
// Registration

@Test
internal fun registerEndpoint_successful() = coroutineScope.runBlockingTest {
internal fun registerEndpoint_successful() = coroutineScope.runTest {
val replyMessage = buildAuthorizationReplyMessage()
whenever(serviceInteractor.sendMessage(any(), any())).thenAnswer {
it.getArgument<((Message) -> Unit)?>(1)(replyMessage)
Expand All @@ -121,15 +123,15 @@ internal class GatewayClientImplTest : MockContextTestCase() {
}

@Test(expected = RegistrationFailedException::class)
internal fun registerEndpoint_withFailedPreRegisterBind() = coroutineScope.runBlockingTest {
internal fun registerEndpoint_withFailedPreRegisterBind() = coroutineScope.runTest {
whenever(serviceInteractor.sendMessage(any(), any()))
.thenThrow(ServiceInteractor.BindFailedException(""))

gatewayClient.registerEndpoint(KeyPairSet.PRIVATE_ENDPOINT)
}

@Test(expected = RegistrationFailedException::class)
internal fun registerEndpoint_withFailedPreRegisterSend() = coroutineScope.runBlockingTest {
internal fun registerEndpoint_withFailedPreRegisterSend() = coroutineScope.runTest {
whenever(serviceInteractor.sendMessage(any(), any()))
.thenThrow(ServiceInteractor.SendFailedException(Exception()))

Expand All @@ -138,7 +140,7 @@ internal class GatewayClientImplTest : MockContextTestCase() {

@Test(expected = RegistrationFailedException::class)
internal fun registerEndpoint_withFailedRegistrationDueToServer() =
coroutineScope.runBlockingTest {
coroutineScope.runTest {
val replyMessage = buildAuthorizationReplyMessage()
whenever(serviceInteractor.sendMessage(any(), any())).thenAnswer {
it.getArgument<((Message) -> Unit)?>(1)(replyMessage)
Expand All @@ -152,7 +154,7 @@ internal class GatewayClientImplTest : MockContextTestCase() {

@Test(expected = GatewayProtocolException::class)
internal fun registerEndpoint_withFailedRegistrationDueToClient() =
coroutineScope.runBlockingTest {
coroutineScope.runTest {
val replyMessage = buildAuthorizationReplyMessage()
whenever(serviceInteractor.sendMessage(any(), any())).thenAnswer {
it.getArgument<((Message) -> Unit)?>(1)(replyMessage)
Expand All @@ -179,7 +181,7 @@ internal class GatewayClientImplTest : MockContextTestCase() {
// Messaging

@Test
fun sendMessage_successful() = coroutineScope.runBlockingTest {
fun sendMessage_successful() = coroutineScope.runTest {
val message =
MessageFactory.buildOutgoing(createEndpointChannel(RecipientAddressType.PUBLIC))

Expand All @@ -188,15 +190,15 @@ internal class GatewayClientImplTest : MockContextTestCase() {
}

@Test(expected = GatewayBindingException::class)
fun sendMessage_withoutBind() = coroutineScope.runBlockingTest {
fun sendMessage_withoutBind() = coroutineScope.runTest {
val message =
MessageFactory.buildOutgoing(createEndpointChannel(RecipientAddressType.PUBLIC))

gatewayClient.sendMessage(message)
}

@Test(expected = SendMessageException::class)
fun sendMessage_unsuccessful() = coroutineScope.runBlockingTest {
fun sendMessage_unsuccessful() = coroutineScope.runTest {
whenever(sendMessage.send(any())).thenThrow(SendMessageException(""))
val message =
MessageFactory.buildOutgoing(createEndpointChannel(RecipientAddressType.PUBLIC))
Expand All @@ -206,7 +208,7 @@ internal class GatewayClientImplTest : MockContextTestCase() {
}

@Test(expected = GatewayProtocolException::class)
fun sendMessage_unsuccessfulDueToClient() = coroutineScope.runBlockingTest {
fun sendMessage_unsuccessfulDueToClient() = coroutineScope.runTest {
whenever(sendMessage.send(any())).thenThrow(GatewayProtocolException(""))
val message =
MessageFactory.buildOutgoing(createEndpointChannel(RecipientAddressType.PUBLIC))
Expand All @@ -216,7 +218,7 @@ internal class GatewayClientImplTest : MockContextTestCase() {
}

@Test(expected = RejectedMessageException::class)
fun sendMessage_unsuccessfulDueToRejection() = coroutineScope.runBlockingTest {
fun sendMessage_unsuccessfulDueToRejection() = coroutineScope.runTest {
whenever(sendMessage.send(any())).thenThrow(RejectedMessageException(""))
val message =
MessageFactory.buildOutgoing(createEndpointChannel(RecipientAddressType.PUBLIC))
Expand All @@ -226,7 +228,7 @@ internal class GatewayClientImplTest : MockContextTestCase() {
}

@Test
fun checkForNewMessages_bindsIfNeeded() = coroutineScope.runBlockingTest {
fun checkForNewMessages_bindsIfNeeded() = coroutineScope.runTest {
whenever(receiveMessages.receive()).thenReturn(emptyFlow())

gatewayClient.checkForNewMessages()
Expand All @@ -242,7 +244,7 @@ internal class GatewayClientImplTest : MockContextTestCase() {
}

@Test
fun checkForNewMessages_doesNotRebind() = coroutineScope.runBlockingTest {
fun checkForNewMessages_doesNotRebind() = coroutineScope.runTest {
whenever(receiveMessages.receive()).thenReturn(emptyFlow())

gatewayClient.bind()
Expand All @@ -252,12 +254,12 @@ internal class GatewayClientImplTest : MockContextTestCase() {
}

@Test
fun checkForNewMessages_relaysIncomingMessages() = coroutineScope.runBlockingTest {
fun checkForNewMessages_relaysIncomingMessages() = coroutineScope.runTest {
val message = MessageFactory.buildIncoming()
whenever(receiveMessages.receive()).thenReturn(flowOf(message))

val messagesReceived = mutableListOf<IncomingMessage>()
TestCoroutineScope().launch {
CoroutineScope(UnconfinedTestDispatcher()).launch {
gatewayClient.receiveMessages().toCollection(messagesReceived)
}

Expand All @@ -267,14 +269,14 @@ internal class GatewayClientImplTest : MockContextTestCase() {
}

@Test
fun checkForNewMessages_handlesReceiveException() = coroutineScope.runBlockingTest {
fun checkForNewMessages_handlesReceiveException() = coroutineScope.runTest {
whenever(receiveMessages.receive()).thenReturn(flow { throw ReceiveMessageException("") })

gatewayClient.checkForNewMessages()
}

@Test
fun checkForNewMessages_handlesProtocolException() = coroutineScope.runBlockingTest {
fun checkForNewMessages_handlesProtocolException() = coroutineScope.runTest {
whenever(receiveMessages.receive()).thenReturn(flow { throw GatewayProtocolException("") })

gatewayClient.checkForNewMessages()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package tech.relaycorp.awaladroid.background

import android.content.Intent
import com.nhaarman.mockitokotlin2.verify
import kotlinx.coroutines.test.runBlockingTest
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.runTest
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
Expand All @@ -12,11 +13,11 @@ import tech.relaycorp.awaladroid.test.MockContextTestCase
@RunWith(RobolectricTestRunner::class)
internal class IncomingParcelBroadcastReceiverTest : MockContextTestCase() {
@Test
fun name() = runBlockingTest {
fun name() = runTest {
val receiver = IncomingParcelBroadcastReceiver()
receiver.coroutineContext = coroutineContext
receiver.onReceive(RuntimeEnvironment.getApplication(), Intent())

advanceUntilIdle()
verify(gatewayClient).checkForNewMessages()
}
}
Loading

0 comments on commit 0661c7b

Please sign in to comment.