From d0eb17400f1e3c3957b12bbd4b2ef43b410c17ef Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Thu, 25 May 2023 13:37:08 +0200 Subject: [PATCH] Sleep a bit to let components process purge requests --- 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 69a815321..1145cb12d 100644 --- a/clientapi/admin_test.go +++ b/clientapi/admin_test.go @@ -133,7 +133,11 @@ func TestPurgeRoom(t *testing.T) { cfg, processCtx, close := testrig.CreateConfig(t, dbType) caches := caching.NewRistrettoCache(128*1024*1024, time.Hour, caching.DisableMetrics) natsInstance := jetstream.NATSInstance{} - defer close() + defer func() { + // give components the time to process purge requests + time.Sleep(time.Millisecond * 50) + close() + }() routers := httputil.NewRouters() cm := sqlutil.NewConnectionManager(processCtx, cfg.Global.DatabaseOptions)