Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1673

Document that max entries specified is best effort and not 100% accurate

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 5.1.0.CR4
    • 5.1.0.CR2
    • Eviction
    • Low

      The following test:

      @Test(groups = "functional", testName = "eviction.MaxEntriesTest")
      public class MaxEntriesTest extends SingleCacheManagerTest {
      
         @Override
         protected EmbeddedCacheManager createCacheManager() throws Exception {
            ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(false);
            builder.eviction().maxEntries(4).strategy(EvictionStrategy.FIFO).build();
            return new DefaultCacheManager(builder.build());
         }
      
         public void test000() {
            cache.put(1, "1");
            assert cache.size() == 1;
            cache.put(2, "2");
            assert cache.size() == 2;
            cache.put(3, "3");
            assert cache.size() == 3 : "Size is: " + cache.size();
         }
         
      }

      Fails with:

      java.lang.AssertionError: Size is: 2

      @Vladimir, is this related to some of your container changes?

              vblagoje Vladimir Blagojevic (Inactive)
              rh-ee-galder Galder ZamarreƱo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: