[8.x](backport #42895) fix(tests): ensure TestFilebeatOTelE2E does not fail if timestamps are equal #42904
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed commit message
The TestFilebeatOTelE2E test sometimes fails in CI. This test is designed to ensure that a document ingested by Filebeat and fbreceiver does not have any meaningful differences. Some fields are expected to change, such as agent.id, log.file.path, and at timestamp.
The test explicitly fails if any of the ignored fields match in both documents, as it assumes these fields should not be ignored. In the case of at timestamp, depending on how fast indexing works, it may sometimes match and sometimes differ, introducing flakiness to the test.
This check seems to do more harm than good and I have already removed it from a similar Elastic Agent test in elastic/elastic-agent#6819.
Example of a build failure caused by this: https://buildkite.com/elastic/beats-xpack-filebeat/builds/11240#01953eac-0d88-4ab5-aa5a-a1dcc909ecd4/179-688.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues
This is an automatic backport of pull request fix(tests): ensure TestFilebeatOTelE2E does not fail if timestamps are equal #42895 done by Mergify.