Repository navigation
Add regression coverage for sharded LRU capacity eviction - #425
Merged
Merged
Conversation
Contributor
|
The TCP test classes run fine in the Windows CI environment. |
Contributor
|
@tbuffagni Thanks for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a cache-level regression test for the multi-shard eviction issue fixed in f54bb2b. Previously, choosing an empty shard could stop eviction even when another shard contained entries, allowing
LRUMemoryCacheto exceedMaxObjects.The test inserts 1024 distinct immutable keys with the same hash code into a cache with MaxObjects=128 and SpoolChunkSize=1. It checks occupancy after every insertion and verifies the resident keys and values after the workload. The same test runs with 1 shard as a control and with 16 shards to exercise empty-shard traversal. Expiry and background shrinking are disabled. This complements the DoubleLinkedList tests already added with the fix and adds no production changes or dependencies.
Validation on Windows with JDK 17.0.2 and Maven 3.9.9:
mvn clean verify: core ran 425 tests, including both new cases passing, but stopped with 1 failure and 11 errors in three existing TCP test classes. The remaining reactor modules were not reached. These involve localhost connection/write timeouts and an expected ALIVE status reported as ERROR. Running only those three existing classes outside the restricted execution environment, without running the new regression test, reproduced the same 1 failure and 11 errors. Therefore full-suite success is not claimed for this Windows environment.Existing TCP classes affected in the full run and isolated recheck:
Focused command:
mvn -B -ntp -pl commons-jcs4-core -am -Dtest=LRUMemoryCacheUnitTest -Dsurefire.failIfNoSpecifiedTests=false test