From 97ce47ed3e33b0ef8833664c4b88237d9f07ec2e Mon Sep 17 00:00:00 2001 From: Dmitrii Anoshin Date: Mon, 17 Jun 2024 06:20:30 -0700 Subject: [PATCH] [chore] [receiver/mongodb] Enable lifecycle tests (#33588) --- receiver/mongodbreceiver/generated_component_test.go | 12 ++++++++++++ receiver/mongodbreceiver/metadata.yaml | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/receiver/mongodbreceiver/generated_component_test.go b/receiver/mongodbreceiver/generated_component_test.go index 19d7793a265c..2ab097eb039c 100644 --- a/receiver/mongodbreceiver/generated_component_test.go +++ b/receiver/mongodbreceiver/generated_component_test.go @@ -53,5 +53,17 @@ func TestComponentLifecycle(t *testing.T) { err = c.Shutdown(context.Background()) require.NoError(t, err) }) + t.Run(test.name+"-lifecycle", func(t *testing.T) { + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) + require.NoError(t, err) + host := componenttest.NewNopHost() + require.NoError(t, err) + require.NoError(t, firstRcvr.Start(context.Background(), host)) + require.NoError(t, firstRcvr.Shutdown(context.Background())) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) + require.NoError(t, err) + require.NoError(t, secondRcvr.Start(context.Background(), host)) + require.NoError(t, secondRcvr.Shutdown(context.Background())) + }) } } diff --git a/receiver/mongodbreceiver/metadata.yaml b/receiver/mongodbreceiver/metadata.yaml index d70fc2d43f2b..689c93353cce 100644 --- a/receiver/mongodbreceiver/metadata.yaml +++ b/receiver/mongodbreceiver/metadata.yaml @@ -352,6 +352,6 @@ metrics: aggregation_temporality: cumulative attributes: [ ] -# TODO: Update the receiver to pass the tests tests: - skip_lifecycle: true + config: + timeout: 1ms