withTimeout

suspend fun <T> withTimeout(duration: Duration, block: suspend CoroutineScope.() -> T): T(source)
suspend fun <T> withTimeout(duration: Duration, block: suspend CoroutineScope.() -> T): T(source)
suspend fun <T> withTimeout(millis: Long, block: suspend CoroutineScope.() -> T): T(source)

Use this instead of kotlinx.coroutines.withTimeout as that throws TimeoutCancellationException which extends CancellationException and can result in unexpected behaviour