Skip to content

Commit bff7507

Browse files
author
Sebastien Stormacq
committed
replace a do {} catch {} with #expect(throwing:)
1 parent c07555a commit bff7507

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Tests/AWSLambdaRuntimeTests/PoolTests.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ struct PoolTests {
460460
let pool = LambdaHTTPServer.Pool<LambdaHTTPServer.LocalServerResponse>()
461461

462462
// Test that cancellation properly cleans up all continuations
463-
do {
463+
await #expect(throws: CancellationError.self) {
464464
try await withThrowingTaskGroup(of: Void.self) { group in
465465
// Start multiple consumers for different requestIds
466466
group.addTask {
@@ -481,9 +481,7 @@ struct PoolTests {
481481

482482
try await group.waitForAll()
483483
}
484-
} catch is CancellationError {
485-
// Expected - tasks should be cancelled
486-
}
484+
}
487485

488486
// Pool should be back to clean state - verify by pushing and consuming normally
489487
pool.push(LambdaHTTPServer.LocalServerResponse(id: "new-req", body: ByteBuffer(string: "new-data")))

0 commit comments

Comments
 (0)