From c0074c737e93f32a5809e398491159fbdf01469c Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Mon, 20 Jan 2025 17:12:32 +0000 Subject: [PATCH] test(coderd/database/awsiamrds): fix unclosed pubsub --- coderd/database/awsiamrds/awsiamrds_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coderd/database/awsiamrds/awsiamrds_test.go b/coderd/database/awsiamrds/awsiamrds_test.go index d52da4aab7bfe..047d0684c93b5 100644 --- a/coderd/database/awsiamrds/awsiamrds_test.go +++ b/coderd/database/awsiamrds/awsiamrds_test.go @@ -52,13 +52,14 @@ func TestDriver(t *testing.T) { ps, err := pubsub.New(ctx, logger, db, url) require.NoError(t, err) + defer ps.Close() gotChan := make(chan struct{}) subCancel, err := ps.Subscribe("test", func(_ context.Context, _ []byte) { close(gotChan) }) - defer subCancel() require.NoError(t, err) + defer subCancel() err = ps.Publish("test", []byte("hello")) require.NoError(t, err)