File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Tests/AWSLambdaRuntimeTests Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -30,20 +30,21 @@ struct LambdaRuntimeTests {
3030 let runtime1 = LambdaRuntime (
3131 handler: MockHandler ( ) ,
3232 eventLoop: Lambda . defaultEventLoop,
33- logger: Logger ( label: " Runtime1 " )
33+ logger: Logger ( label: " LambdaRuntimeTests. Runtime1" )
3434 )
3535
3636 // Second runtime
3737 let runtime2 = LambdaRuntime (
3838 handler: MockHandler ( ) ,
3939 eventLoop: Lambda . defaultEventLoop,
40- logger: Logger ( label: " Runtime1 " )
40+ logger: Logger ( label: " LambdaRuntimeTests.Runtime2 " )
4141 )
4242
4343 try await withThrowingTaskGroup ( of: Void . self) { taskGroup in
4444 // start the first runtime
4545 taskGroup. addTask {
46- await #expect( throws: Never . self) {
46+ // ChannelError will be thrown when we cancel the task group
47+ await #expect( throws: ChannelError . self) {
4748 try await runtime1. run ( )
4849 }
4950 }
@@ -63,7 +64,10 @@ struct LambdaRuntimeTests {
6364 // Running the second runtime should work now
6465 try await withThrowingTaskGroup ( of: Void . self) { taskGroup in
6566 taskGroup. addTask {
66- await #expect( throws: Never . self) { try await runtime2. run ( ) }
67+ // ChannelError will be thrown when we cancel the task group
68+ await #expect( throws: ChannelError . self) {
69+ try await runtime2. run ( )
70+ }
6771 }
6872
6973 // Set timeout and cancel the runtime 2
You can’t perform that action at this time.
0 commit comments