diff --git a/library/runtime/src/commonMain/kotlin/io/matthewnelson/kmp/tor/runtime/TorRuntime.kt b/library/runtime/src/commonMain/kotlin/io/matthewnelson/kmp/tor/runtime/TorRuntime.kt index 7ee09544..c73c9f78 100644 --- a/library/runtime/src/commonMain/kotlin/io/matthewnelson/kmp/tor/runtime/TorRuntime.kt +++ b/library/runtime/src/commonMain/kotlin/io/matthewnelson/kmp/tor/runtime/TorRuntime.kt @@ -561,10 +561,10 @@ public sealed interface TorRuntime: } /** - * An instance of [TorRuntime] which produces [Lifecycle.DestroyableTorRuntime] + * An instance of [TorRuntime] that produces [Lifecycle.DestroyableTorRuntime] * under the hood which are intended to be run within a service object. * - * **NOTE:** This and its subclasses are currently an [ExperimentalKmpTorApi]. + * **NOTE:** This and its subclasses are currently marked as [ExperimentalKmpTorApi]. * Things may change (as the annotation states), so use at your own risk! Prefer * using the stable implementation via the `kmp-tor:runtime-service` dependency. * @@ -669,7 +669,7 @@ public sealed interface TorRuntime: * * Implementors of [ServiceFactory.startService] must start the service * and call [Binder.onBind] from the injected [binder] reference within - * 500ms, otherwise a timeout will occur and all enqueued jobs waiting + * 1_000ms, otherwise a timeout will occur and all enqueued jobs waiting * to be handed off to [Lifecycle.DestroyableTorRuntime] for completion * will be terminated. * diff --git a/library/runtime/src/commonMain/kotlin/io/matthewnelson/kmp/tor/runtime/internal/RealTorRuntime.kt b/library/runtime/src/commonMain/kotlin/io/matthewnelson/kmp/tor/runtime/internal/RealTorRuntime.kt index b8811820..a1e28a01 100644 --- a/library/runtime/src/commonMain/kotlin/io/matthewnelson/kmp/tor/runtime/internal/RealTorRuntime.kt +++ b/library/runtime/src/commonMain/kotlin/io/matthewnelson/kmp/tor/runtime/internal/RealTorRuntime.kt @@ -956,13 +956,14 @@ internal class RealTorRuntime private constructor( _failure = t } - // Wait for 500ms + // Wait for service startup TimeSource.Monotonic.markNow().let { mark -> // Node.js uses Dispatchers.Main so the test coroutine - // library will not wait an actual 500ms. Make it so - // there's a 500ms delay no matter what. + // library will not wait an actual timeout. Make it so + // there's a delay no matter what. val interval = 100.milliseconds - val timeout = 500.milliseconds + val timeout = 1_000.milliseconds + while (isActive) { if (_failure != null) break if (_instance != null) break @@ -970,7 +971,7 @@ internal class RealTorRuntime private constructor( if (_failure != null) break if (_instance != null) break if (mark.elapsedNow() < timeout) continue - _failure = InterruptedException("${name.name} timed out after 500ms") + _failure = InterruptedException("${name.name} timed out after 1000ms") } }