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.
Этот коммит содержится в:
Alejandro García Montoro
2026-04-17 19:27:42 +02:00
коммит произвёл GitHub
родитель 73d5f507a4
Коммит 29dd6d0cfd

Просмотреть файл

@@ -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)