Skip to content

Commit 6ada041

Browse files
sebstofabianfett
andauthored
Update Tests/AWSLambdaRuntimeTests/LambdaRuntimeTests.swift
Co-authored-by: Fabian Fett <[email protected]>
1 parent 918492a commit 6ada041

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Diff for: Tests/AWSLambdaRuntimeTests/LambdaRuntimeTests.swift

+4-6
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,14 @@ struct LambdaRuntimeTests {
6262
}
6363

6464
// 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()
65+
try await withThrowingTaskGroup(of: Void.self) { taskGroup in
66+
taskGroup.addTask {
67+
await #expect(throws: Never.self) { try await runtime2.run() }
6968
}
7069

7170
// Set timeout and cancel the runtime 2
7271
try await Task.sleep(for: .seconds(2))
73-
nonReturningTask.cancel()
74-
72+
taskGroup.cancelAll()
7573
}
7674
}
7775
}

0 commit comments

Comments
 (0)