From 5971897683c934ac156add6991b659e45df9cef2 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Fri, 5 Dec 2025 00:52:27 +0100 Subject: [PATCH] Rethrow error thrown from `withAsyncTestingChannel` closure Currently, when the closure of `withAsyncTestingChannel` throws, the error is just swallowed silently and the test passes. Actually rethrow it so the test fails --- Tests/PostgresNIOTests/New/PostgresConnectionTests.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/PostgresNIOTests/New/PostgresConnectionTests.swift b/Tests/PostgresNIOTests/New/PostgresConnectionTests.swift index 28c593cb..acac9efe 100644 --- a/Tests/PostgresNIOTests/New/PostgresConnectionTests.swift +++ b/Tests/PostgresNIOTests/New/PostgresConnectionTests.swift @@ -964,7 +964,8 @@ import Synchronization do { try await body(connection, channel) } catch { - + try await connection.close() + throw error } try await connection.close()