Skip to content

More EvictableCache tests#14502

Merged
findepi merged 3 commits intotrinodb:masterfrom
findepi:findepi/evictly
Oct 11, 2022
Merged

More EvictableCache tests#14502
findepi merged 3 commits intotrinodb:masterfrom
findepi:findepi/evictly

Conversation

@findepi
Copy link
Copy Markdown
Member

@findepi findepi commented Oct 6, 2022

In #14476 (comment) it became apparent we have no tests ensuring no memory leak in EvictableCache. This PR improves test coverage around that.

@findepi findepi added test no-release-notes This pull request does not require release notes entry labels Oct 6, 2022
@cla-bot cla-bot bot added the cla-signed label Oct 6, 2022
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is being addressed by #14476

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is being addressed by #14476

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extract 10_000 to variable

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i chose not to apply this one, hope it's fine

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract 10_000

It was recently discovered we lack a test ensuring that time-based cache
has it's entries evicted, and not e.g. using unbounded amount of memory.
@findepi
Copy link
Copy Markdown
Member Author

findepi commented Oct 10, 2022

AC

ticker.increment(ttl, MILLISECONDS);
// Should be reloaded
assertEquals(cache.get(key, () -> "new value"), "new value");
// TODO (https://github.com/trinodb/trino/issues/14545) tokensCount should be 1; 0 means we lost the token for a live entry
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #14545

@findepi
Copy link
Copy Markdown
Member Author

findepi commented Oct 10, 2022

CI #13166, #13633, #14546 :(

@findepi findepi merged commit bdd3132 into trinodb:master Oct 11, 2022
@findepi findepi deleted the findepi/evictly branch October 11, 2022 08:34
@github-actions github-actions bot added this to the 400 milestone Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed no-release-notes This pull request does not require release notes entry test

Development

Successfully merging this pull request may close these issues.

2 participants