From 2bf6a4a07f474eba20969e6a925f932e5f840cb1 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Sat, 11 May 2024 13:10:33 +0200 Subject: [PATCH] defer shutdown assertion --- receiver/podmanreceiver/receiver_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/receiver/podmanreceiver/receiver_test.go b/receiver/podmanreceiver/receiver_test.go index 8db911c00bc5..eb8e691e2b01 100644 --- a/receiver/podmanreceiver/receiver_test.go +++ b/receiver/podmanreceiver/receiver_test.go @@ -69,14 +69,13 @@ func TestScraperLoop(t *testing.T) { }() assert.NoError(t, r.start(ctx, componenttest.NewNopHost())) + defer assert.NoError(t, r.shutdown(ctx)) md, err := r.scrape(ctx) assert.NoError(t, err) assert.Equal(t, 1, md.ResourceMetrics().Len()) assertStatsEqualToMetrics(t, genContainerStats(), md) - - assert.NoError(t, r.shutdown(ctx)) } type mockClient chan containerStatsReport