Hi, I'm playing with `withTimeout` and I'd like to...
# coroutines
c
Hi, I'm playing with
withTimeout
and I'd like to run unit tests to validate the behavior, but I can't make it work.
Copy code
@ExperimentalCoroutinesApi
    @Test
    fun withTimeout() = runTest {
        val result = withTimeout(1_000L) {
            try{
                runInterruptible {
                    Thread.sleep(2_000L)
                    Result.success(42)
                }
            } catch (e: Exception) {
                Result.failure(e)
            }
        }
        assert(result.isFailure) // Assertion failed
    }
Do you have any idea how to make such a test succeed?