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

Fix for the flaky OTel log test - by synchronizing the evictions #5363

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

san81
Copy link
Collaborator

@san81 san81 commented Jan 27, 2025

Description

Caffeine cache evictions happen in async mode that leaves no control to a test method to guarantee the max size limit is enforced. If we have to enforce max size then we need to ask Caffeine to do evictions synchronously. But setting the max cache size to zero disables the cache and gives more consistent behavior. Read more here https://www.javadoc.io/doc/com.github.ben-manes.caffeine/caffeine/2.0.3/com/github/benmanes/caffeine/cache/Caffeine.html#maximumSize-long-

To fix this flaky test, I suggest to set the max size to zero. Basically, disable the cache instead of setting the max size to 1.

Issues Resolved

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant