From 29dd6d0cfdb7111adfe42d8535051baabed42935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Garc=C3=ADa=20Montoro?= Date: Fri, 17 Apr 2026 19:27:42 +0200 Subject: [PATCH] MM-68369: add missing TearDown in TestWebConnRejectBinaryFrameUnauthenticated (#36172) The test at channels/app/platform/web_conn_test.go was added by #35988 without a defer th.TearDown() call. Setup(t) creates a PlatformService that opens its own SqlStore pool and runs morph migrations against the shared temp database. Without TearDown, that pool stays alive until TestMain exits, so the morph-held idle connections are still attached to the database when MainHelper.Close runs DROP DATABASE. Postgres refuses the drop with "is being accessed by other users" and the whole package panics in teardown. On master and release-11.4 and later, setupTestHelper registers the shutdown via tb.Cleanup automatically, so the same test does not leak there. release-10.11 still uses the manual TearDown pattern, which is why the fix is scoped to this branch. --- server/channels/app/platform/web_conn_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/channels/app/platform/web_conn_test.go b/server/channels/app/platform/web_conn_test.go index 24b893daa5..d07cf64a7a 100644 --- a/server/channels/app/platform/web_conn_test.go +++ b/server/channels/app/platform/web_conn_test.go @@ -245,6 +245,7 @@ func TestWebConnDrainDeadQueue(t *testing.T) { func TestWebConnRejectBinaryFrameUnauthenticated(t *testing.T) { th := Setup(t) + defer th.TearDown() readPumpDone := make(chan struct{}) upgradeErrCh := make(chan error, 1)