tbuffagni opened a new pull request, #425: URL: https://github.com/apache/commons-jcs/pull/425
Add a cache-level regression test for the multi-shard eviction issue fixed in https://github.com/apache/commons-jcs/commit/f54bb2b058427c03dee43576ad2df6748aa3f56d. Previously, choosing an empty shard could stop eviction even when another shard contained entries, allowing `LRUMemoryCache` to exceed `MaxObjects`. 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: - On master ef66ce7f0c12ccace5fcbc8afbcbf29211b8b09c: both parameterized cases pass. - Against the preserved, unmodified d38be5b5f688c29e83447127df36cec5220a750f JAR: the same test source passes with 1 shard and fails with 16 shards at insertion 129 (expected 128 residents, found 129). - Full `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: - LateralTCPFilterRemoveHashCodeUnitTest - LateralTCPIssueRemoveOnPutUnitTest - TestTCPLateralUnitTest Focused command: ```sh mvn -B -ntp -pl commons-jcs4-core -am -Dtest=LRUMemoryCacheUnitTest -Dsurefire.failIfNoSpecifiedTests=false test ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
