Skip to content

[8.19] (backport #6819) otel: fix flakiness and enable logs_dynamic_id in TestFBOtelRestartE2E#8006

Merged
mauri870 merged 1 commit into8.19from
mergify/bp/8.19/pr-6819
Apr 28, 2025
Merged

[8.19] (backport #6819) otel: fix flakiness and enable logs_dynamic_id in TestFBOtelRestartE2E#8006
mauri870 merged 1 commit into8.19from
mergify/bp/8.19/pr-6819

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Apr 28, 2025

What does this PR do?

This test starts the collector with a timeout, but the error returned is not
always a context cancelled, sometimes it returns err == nil, which is also
fine, just not handled properly.

While at it, fix some other issues I found while testing:

  • Using require inside a goroutine calls runtime.GoExit on failure, meaning
    the test exits immediatelly without doing any cleanup, causing resource leaks. Use assert in those
    cases.
  • Now with the beats dependency up to date, deduplication works as intended otelconsumer: set document id attribute for elasticsearchexporter beats#42412. Update the test to use logs_dynamic_id in the elasticsearchexporter options and assert data is deduplicated in Elasticsearch.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Related issues

…tE2E (#6819)

* otel: fix flaky behavior on TestFBOtelRestartE2E

This test starts the collector with a timeout, but the error returned is not
always a context cancelled, sometimes it returns err == nil, which is also
fine, just not handled properly.

While at it, fix some other issues I found while testing:

- Using require inside a goroutine calls runtime.GoExit on failure, meaning
  the test exits immediatelly without doing any cleanup. Use assert in those
  cases.

* don't fail if ignored field is equal

* use a different index name to avoid conflicts

* Update testing/integration/otel_test.go

Co-authored-by: Paolo Chilà <paolo.chila@elastic.co>

* Update testing/integration/otel_test.go

Co-authored-by: Paolo Chilà <paolo.chila@elastic.co>

* use assert.Conditionf for error check

---------

Co-authored-by: Khushi Jain <khushi.jain@elastic.co>
Co-authored-by: Paolo Chilà <paolo.chila@elastic.co>
(cherry picked from commit 82460a2)
@mergify mergify bot added the backport label Apr 28, 2025
@mergify mergify bot requested a review from a team as a code owner April 28, 2025 14:12
@mergify mergify bot requested review from pchila and ycombinator and removed request for a team April 28, 2025 14:12
@github-actions github-actions bot added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team skip-changelog labels Apr 28, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@mauri870 mauri870 enabled auto-merge (squash) April 28, 2025 14:16
@elastic-sonarqube
Copy link

@mauri870 mauri870 merged commit 094b586 into 8.19 Apr 28, 2025
14 checks passed
@mauri870 mauri870 deleted the mergify/bp/8.19/pr-6819 branch April 28, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments