From 50f8466290945377a34ab41eaa0eea2e893ff3e5 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Mon, 6 Feb 2023 11:18:19 +0100 Subject: [PATCH] Wait a bit before closing Dendrite to let components process events --- clientapi/admin_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clientapi/admin_test.go b/clientapi/admin_test.go index c7ca019ff..06922963d 100644 --- a/clientapi/admin_test.go +++ b/clientapi/admin_test.go @@ -5,6 +5,7 @@ import ( "net/http" "net/http/httptest" "testing" + "time" "github.com/matrix-org/dendrite/clientapi/auth/authtypes" "github.com/matrix-org/dendrite/federationapi" @@ -151,7 +152,10 @@ func TestPurgeRoom(t *testing.T) { test.WithAllDatabases(t, func(t *testing.T, dbType test.DBType) { base, baseClose := testrig.CreateBaseDendrite(t, dbType) - defer baseClose() + t.Cleanup(func() { + time.Sleep(time.Millisecond * 50) + baseClose() + }) fedClient := base.CreateFederationClient() rsAPI := roomserver.NewInternalAPI(base)