Skip to content

Commit f8dec7a

Browse files
authored
Do not wait for timeouts to finish in XCTestCase.task (#24)
1 parent f9bb565 commit f8dec7a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Sources/AsyncTestExtensions/XCTestCase+AsyncTestExtensions.swift

+8-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ public extension XCTestCase {
2727
return value
2828
}
2929

30-
for try await value in group {
31-
return value
30+
do {
31+
for try await value in group {
32+
group.cancelAll()
33+
return value
34+
}
35+
} catch {
36+
group.cancelAll()
37+
throw error
3238
}
3339

3440
preconditionFailure()

0 commit comments

Comments
 (0)