From e7b929a3b7559a5eb41db61641038bf2cbedf1b4 Mon Sep 17 00:00:00 2001 From: Victor Shamanov Date: Wed, 15 Nov 2023 01:31:14 +0000 Subject: [PATCH] Use NSEC_PER_SEC --- Chatto/Tests/ObservableAsyncStreamTests.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Chatto/Tests/ObservableAsyncStreamTests.swift b/Chatto/Tests/ObservableAsyncStreamTests.swift index f8eaa879..0d7d8f52 100644 --- a/Chatto/Tests/ObservableAsyncStreamTests.swift +++ b/Chatto/Tests/ObservableAsyncStreamTests.swift @@ -24,6 +24,7 @@ import Foundation import XCTest import Chatto +import Dispatch @available(iOS 13, *) final class ObservableAsyncStreamTests: XCTestCase { @@ -62,7 +63,7 @@ final class ObservableAsyncStreamTests: XCTestCase { try await withThrowingTaskGroup(of: T.self) { group in group.addTask { try await operation() } group.addTask { - try await Task.sleep(nanoseconds: 100_000_000) + try await Task.sleep(nanoseconds: NSEC_PER_SEC / 10) throw TimeoutError() } let result = try await group.next()!