diff --git a/Sources/Nimble/Utils/Async.swift b/Sources/Nimble/Utils/Async.swift index b9898f804..f3c3886d4 100644 --- a/Sources/Nimble/Utils/Async.swift +++ b/Sources/Nimble/Utils/Async.swift @@ -256,7 +256,11 @@ internal class AwaitPromiseBuilder { self.trigger.timeoutSource.resume() while self.promise.asyncResult.isIncomplete() { // Stopping the run loop does not work unless we run only 1 mode + #if swift(>=4.2) + _ = RunLoop.current.run(mode: .default, before: .distantFuture) + #else _ = RunLoop.current.run(mode: .defaultRunLoopMode, before: .distantFuture) + #endif } self.trigger.timeoutSource.cancel()