Skip to content

Commit

Permalink
Disable tests failing on Native
Browse files Browse the repository at this point in the history
  • Loading branch information
dkhalanskyjb committed Oct 25, 2021
1 parent 74a567f commit 3ba7c52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
2 changes: 2 additions & 0 deletions kotlinx-coroutines-test/common/test/RunTestTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class RunTestTest {

/** Tests that too low of a dispatch timeout causes crashes. */
@Test
@Ignore // TODO: timeout leads to `Cannot execute task because event loop was shut down` on Native
fun testRunTestWithSmallTimeout() = testResultMap({ fn ->
assertFailsWith<UncompletedCoroutinesError> { fn() }
}) {
Expand All @@ -105,6 +106,7 @@ class RunTestTest {

/** Tests uncaught exceptions taking priority over dispatch timeout in error reports. */
@Test
@Ignore // TODO: timeout leads to `Cannot execute task because event loop was shut down` on Native
fun testRunTestTimingOutAndThrowing() = testResultMap({ fn ->
assertFailsWith<IllegalArgumentException> { fn() }
}) {
Expand Down
23 changes: 9 additions & 14 deletions kotlinx-coroutines-test/js/test/Helpers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@

package kotlinx.coroutines.test

import kotlinx.coroutines.*

actual fun testResultMap(block: (() -> Unit) -> Unit, test: () -> TestResult): TestResult =
GlobalScope.promise {
val promise = test()
promise.then(
{
block {
}
}, {
block {
throw it
}
})
}
test().then(
{
block {
}
}, {
block {
throw it
}
})

0 comments on commit 3ba7c52

Please sign in to comment.