Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
123456789101112131415161718192021222324@testable import ParcelTestSupport
// This only guards hung fixtures; injected schedulers own the deadlines under test.func waitForTestEvent<Value: Sendable>( _ events: AsyncStream<Value>, matching condition: @escaping @Sendable (Value) -> Bool = { _ in true }, timeout: Duration = .seconds(30), label: String) async throws { try await withThrowingTaskGroup(of: Void.self) { group in group.addTask { for await event in events { if condition(event) { return } } try Task.checkCancellation() throw E2EError(description: "Event stream ended before \(label)") } group.addTask { try await Task.sleep(for: timeout) throw E2EError(description: "Timed out waiting for \(label)") } defer { group.cancelAll() } try await group.next() }}