We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 918492a commit 6ada041Copy full SHA for 6ada041
Tests/AWSLambdaRuntimeTests/LambdaRuntimeTests.swift
@@ -62,16 +62,14 @@ struct LambdaRuntimeTests {
62
}
63
64
// Running the second runtime should work now
65
- await #expect(throws: Never.self) {
66
-
67
- let nonReturningTask = Task.detached(priority: .userInitiated) {
68
- try await runtime2.run()
+ try await withThrowingTaskGroup(of: Void.self) { taskGroup in
+ taskGroup.addTask {
+ await #expect(throws: Never.self) { try await runtime2.run() }
69
70
71
// Set timeout and cancel the runtime 2
72
try await Task.sleep(for: .seconds(2))
73
- nonReturningTask.cancel()
74
+ taskGroup.cancelAll()
75
76
77
0 commit comments