Skip to content
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

[chore] Fix windowseventlogreceiver test flakiness #34793

Conversation

pjanotti
Copy link
Contributor

Description:
There are 3 main issues being addressed on this PR:

  • There is a race between start and generating the events in the tests: the start require goroutines so a delay before generating the events will be advisable (not perfect but good enough per my tests)
  • The tests assume that only the tests are generating events in that time window, that is impossible to guarantee on a windows box, so instead of checking for exactly one event they need to get new events and check the event provider instead
  • The exclusion test checks if zero events were delivered by the receiver, it should check if one not filtered out was received, and this one should be generated after the event from the provider that should be excluded.

Link to tracking Issue:
Fixes #34687

Testing:
Multiple local runs, we should do a few runs on CI given the runner characteristics.

Documentation:
N/A

@pjanotti pjanotti changed the title Fix windowseventlogreceiver test flakiness [chore] Fix windowseventlogreceiver test flakiness Aug 21, 2024
@dmitryax dmitryax merged commit a6c9b9f into open-telemetry:main Aug 22, 2024
169 of 172 checks passed
@github-actions github-actions bot added this to the next release milestone Aug 22, 2024
@pjanotti pjanotti deleted the fix-windowseventlogreceiver-test-flakiness branch August 22, 2024 17:20
@djaglowski
Copy link
Member

@pjanotti, I'm seeing failures (example) on #34720 which I think might be related to these changes.

From what I can tell, we are failing a require.EventuallyWithT check, but then continuing with the assumption that it succeeded.

@pjanotti
Copy link
Contributor Author

pjanotti commented Sep 3, 2024

Thanks @djaglowski - I'll look into it.

f7o pushed a commit to f7o/opentelemetry-collector-contrib that referenced this pull request Sep 12, 2024
)

**Description:**
There are 3 main issues being addressed on this PR:

* There is a race between start and generating the events in the tests:
the start require goroutines so a delay before generating the events
will be advisable (not perfect but good enough per my tests)
* The tests assume that only the tests are generating events in that
time window, that is impossible to guarantee on a windows box, so
instead of checking for exactly one event they need to get new events
and check the event provider instead
* The exclusion test checks if zero events were delivered by the
receiver, it should check if one not filtered out was received, and this
one should be generated after the event from the provider that should be
excluded.

**Link to tracking Issue:**
Fixes open-telemetry#34687

**Testing:**
Multiple local runs, we should do a few runs on CI given the runner
characteristics.

**Documentation:**
N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os:windows receiver/windowseventlog Run Windows Enable running windows test on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[receiver/windowseventlog] Flaky test TestReadWindowsEventLogger
6 participants