Skip to content

[extension/sumologic] Extension test does not call Start #44608

@mx-psi

Description

@mx-psi

Pinging Sumologic extension code owners: @rnishtala-sumo @chan-tim-sumo @amdprophet

The TestUpdateMetadataRequestPayload test in extension/sumologicextension/extension_test.go calls SumologicExtension.getHTTPClient without calling SumologicExtension.Start first, which leads to confighttp.ClientConfig.ToClient being called with a nil host. This used to work as long as no authentication/middleware was configured, but it poses a problem now that components are expected to call host.GetExtensions() upfront, before calling ToClient; the most straightforward fix of the extension code leads to a segfault in the test.

I tried adding a call to Start in between, but I think the heartbeat loop started in the process causes the test to fail very verbosely. So I just manually set SumologicExtension.host to a no-op host instead. This is not a very elegant fix, so I will leave it to y'all to figure out what you want to do long term. Presumably, this would involve either:

  • considering a nil SumologicExtension.host to be a valid state, and putting a condition around the call to GetExtensions(), or
  • modifying the test to start the component with a valid host, but in a way which doesn't fail the test.

Originally posted by @jade-guiton-dd in #44591 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions