From 16246d702495d2de6b242454480ce4136c68df59 Mon Sep 17 00:00:00 2001 From: Curtis Robert Date: Thu, 4 Jan 2024 08:48:40 -0800 Subject: [PATCH] Use t.Cleanup to make sure shutdown is called. --- exporter/exporterhelper/queue_sender_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter/exporterhelper/queue_sender_test.go b/exporter/exporterhelper/queue_sender_test.go index 0af3c37b354..e6d4a1852d9 100644 --- a/exporter/exporterhelper/queue_sender_test.go +++ b/exporter/exporterhelper/queue_sender_test.go @@ -325,10 +325,10 @@ func TestQueuedRetryPersistentEnabled_NoDataLossOnShutdown(t *testing.T) { newNoopObsrepSender, WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) require.NoError(t, be.Start(context.Background(), host)) + t.Cleanup(func() { require.NoError(t, be.Shutdown(context.Background())) }) // wait for the item to be consumed from the queue replacedReq.checkNumRequests(t, 1) - require.NoError(t, be.Shutdown(context.Background())) } func TestQueueSenderNoStartShutdown(t *testing.T) {