Skip to content

Commit

Permalink
Fix cancellation support
Browse files Browse the repository at this point in the history
  • Loading branch information
wiruzx committed Dec 4, 2023
1 parent e7b929a commit 28e0eaa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Chatto/Tests/ObservableAsyncStreamTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ final class ObservableAsyncStreamTests: XCTestCase {
}
observable = nil

try await withTimeout { await iterateAllStreamValuesTask.value }
try await withTimeout {
await withTaskCancellationHandler {
await iterateAllStreamValuesTask.value
} onCancel: {
iterateAllStreamValuesTask.cancel()
}
}
}

// MARK: - Timeout utils
Expand Down

0 comments on commit 28e0eaa

Please sign in to comment.