File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Tests/PostgresNIOTests/New Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -68,10 +68,8 @@ final class PSQLEventsHandler: ChannelInboundHandler {
6868 case . authenticated:
6969 break
7070 }
71- case TLSUserEvent . shutdownCompleted:
72- break
7371 default :
74- preconditionFailure ( )
72+ context . fireUserInboundEventTriggered ( event )
7573 }
7674 }
7775
Original file line number Diff line number Diff line change @@ -416,6 +416,15 @@ class PostgresConnectionTests: XCTestCase {
416416 }
417417 }
418418
419+ func testWeDontCrashOnUnexpectedChannelEvents( ) async throws {
420+ let ( connection, channel) = try await self . makeTestConnectionWithAsyncTestingChannel ( )
421+
422+ enum MyEvent {
423+ case pleaseDontCrash
424+ }
425+ channel. pipeline. fireUserInboundEventTriggered ( MyEvent . pleaseDontCrash)
426+ }
427+
419428 func testSerialExecutionOfSamePreparedStatement( ) async throws {
420429 let ( connection, channel) = try await self . makeTestConnectionWithAsyncTestingChannel ( )
421430
You can’t perform that action at this time.
0 commit comments