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

test(Java): Add asserations to Local CMC Test #1262

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

texastony
Copy link
Contributor

@texastony texastony commented Jan 28, 2025

Issue #, if available:
All CMCs are Least Recently Used cache.

This revises the test to ensure a very well used entry is never pruned.
The ALWAYS_PICKED entry is inserted right after cache construction with a very long time to live.

10 threads are spun up to test the CMC; 300_000 test over the threads are made to retrieve one of the 22 identifiers.

Each test randomly selects one of the 21 identifiers for a get.
If the get fails, the test issues a put.
The test also, always, issues a get for ID 22.

Cache Hits and Misses are tracked per ID.

Once all tests are completed, the hit/miss of the IDs is printed and some assertions are made, including that ID 22 was never evicted.

Description of changes:

Squash/merge commit message, if applicable:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

All CMCs are Least Recently Used cache.

This revises the test to ensure a very well used entry is never pruned.
The ALWAYS_PICKED entry is inserted right after cache construction with a very long time to live.

10 threads are spun up to test the CMC; 300_000 test over the threads are made to retrieve one of the 22 identifiers.

Each test randomly selects one of the 21 identifiers for a get.
If the get fails, the test issues a put.
The test also, always, issues a get for ID 22.

Cache Hits and Misses are tracked per ID.

Once all tests are completed, the hit/miss of the IDs is printed and some assertions are made, including that ID 22 was never evicted.
@texastony texastony force-pushed the tony/refactor-local-cmc-tests branch from cddb8b9 to c1c3055 Compare January 30, 2025 22:28
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