Skip to content

Commit

Permalink
[chore]move googlecloudpubsubreceiver to generated lifecycle tests (o…
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme authored Dec 18, 2023
1 parent 7a09497 commit 9ebd834
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 0 deletions.
103 changes: 103 additions & 0 deletions receiver/googlecloudpubsubreceiver/generated_component_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions receiver/googlecloudpubsubreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ status:
distributions: [observiq, sumo]
codeowners:
active: [alexvanboxel]

tests:
config:
project: my-project
user_agent: user-agent
timeout: 20s
subscription: projects/my-project/subscriptions/otlp-subscription
skip_lifecycle: true
3 changes: 3 additions & 0 deletions receiver/googlecloudpubsubreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ func (receiver *pubsubReceiver) Start(ctx context.Context, _ component.Host) err
}

func (receiver *pubsubReceiver) Shutdown(_ context.Context) error {
if receiver.handler == nil {
return nil
}
receiver.logger.Info("Stopping Google Pubsub receiver")
receiver.handler.CancelNow()
receiver.logger.Info("Stopped Google Pubsub receiver")
Expand Down

0 comments on commit 9ebd834

Please sign in to comment.