Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pkg/stanza] Fix flaky TestDeleteAfterRead_SkipPartials (open-telemet…
…ry#29597) Fixes open-telemetry#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.
- Loading branch information