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

[pkg/stanza] Fix flaky TestDeleteAfterRead_SkipPartials #29597

Merged

Conversation

djaglowski
Copy link
Member

Fixes #27845

The failure mechanism was very subtle. The test waits for the contents of the short file to be emitted before canceling the context which is used in the file reader. However, the reader may require one additional scan to determine that it's reached the end of the file, and therefore in a tiny proportion of cases, the context cancelation could actually trigger the reader to return before it had determined it should delete the file. The solution involves validating file deletion before canceling the context. I was able to reproduce failure locally only about 1/3000 times, but with this change was able to run 30,000 times without a failure. The PR also cleans up a few related parts of the code.

@djaglowski djaglowski added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Nov 30, 2023
@djaglowski djaglowski force-pushed the pkg-stanza-partial-delete-test branch from fc0c949 to fe131ea Compare December 1, 2023 00:03
@djaglowski djaglowski marked this pull request as ready for review December 1, 2023 02:19
@djaglowski djaglowski requested a review from a team as a code owner December 1, 2023 02:19
@djaglowski djaglowski merged commit 03ad502 into open-telemetry:main Dec 1, 2023
85 checks passed
@djaglowski djaglowski deleted the pkg-stanza-partial-delete-test branch December 1, 2023 15:55
@github-actions github-actions bot added this to the next release milestone Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/stanza Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[pkg/stanza] Flaky test TestDeleteAfterRead_SkipPartials
2 participants