Skip to content

[oteltest][fbreceiver] Fix flaky test #45127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 1, 2025

Conversation

VihasMakwana
Copy link
Contributor

@VihasMakwana VihasMakwana commented Jul 1, 2025

In our otelbeat's test cases, we use require.EventuallyWithT to test certain conditions which are satisfied after some time. For eg. status reporter.
While asserting conditions, we should pass *assert.CollectT variable and not the parent testing.T. Passing the parent variable will lead to instant failure because of the underlying logic of EventuallyWithT.

Closes #45057

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 1, 2025
Copy link
Contributor

github-actions bot commented Jul 1, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

mergify bot commented Jul 1, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @VihasMakwana? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@VihasMakwana VihasMakwana changed the title [debug PR] Fbreceiver flaky [oteltest] Fix flaky test Jul 1, 2025
@VihasMakwana VihasMakwana marked this pull request as ready for review July 1, 2025 10:36
@VihasMakwana VihasMakwana requested a review from a team as a code owner July 1, 2025 10:36
@VihasMakwana VihasMakwana added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Jul 1, 2025
@elasticmachine
Copy link
Collaborator

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

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 1, 2025
@VihasMakwana VihasMakwana added backport-8.19 Automated backport to the 8.19 branch backport-9.1 Automated backport to the 9.1 branch labels Jul 1, 2025
Copy link
Member

@mauri870 mauri870 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check the tests that use this suite as well, to make sure they do not use t inside AssertFunc? Thank you!

@VihasMakwana
Copy link
Contributor Author

Can you check the tests that use this suite as well, to make sure they do not use t inside AssertFunc? Thank you!

yeah, there are some occurrences. I'll update the PR.

@VihasMakwana VihasMakwana changed the title [oteltest] Fix flaky test [oteltest][fbreceiver] Fix flaky test Jul 1, 2025
@VihasMakwana VihasMakwana merged commit dd5cbac into elastic:main Jul 1, 2025
202 checks passed
mergify bot pushed a commit that referenced this pull request Jul 1, 2025
* skip TestReceiverDegraded

* typo

* commit

* replace require.EventuallyWithT

(cherry picked from commit dd5cbac)

# Conflicts:
#	libbeat/otelbeat/oteltest/oteltest.go
#	x-pack/filebeat/fbreceiver/receiver_test.go
mergify bot pushed a commit that referenced this pull request Jul 1, 2025
* skip TestReceiverDegraded

* typo

* commit

* replace require.EventuallyWithT

(cherry picked from commit dd5cbac)
VihasMakwana added a commit that referenced this pull request Jul 2, 2025
* skip TestReceiverDegraded

* typo

* commit

* replace require.EventuallyWithT

(cherry picked from commit dd5cbac)

Co-authored-by: Vihas Makwana <121151420+VihasMakwana@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.19 Automated backport to the 8.19 branch backport-9.1 Automated backport to the 9.1 branch 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.

[fbreceiver/TestReceiverDegraded] - Flaky Test
4 participants