Skip to content

Commit 62fd0be

Browse files
authored
Merge pull request #57 from salesforce/fix-icu-date-parse
fix unstable test
2 parents 217138b + 1a26c74 commit 62fd0be

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/test/java/com/force/i18n/grammar/parser/GrammaticalLabelTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,6 @@ public void testCacheConfig() throws InterruptedException {
553553

554554
GrammaticalLabelSetLoader loader = new GrammaticalLabelSetLoader(config);
555555
loader.getSet(ENGLISH);
556-
557556
Thread.sleep(1);
558557
assertNull(loader.getCache().getIfPresent(desc));
559558

@@ -569,21 +568,25 @@ public void testCacheConfig() throws InterruptedException {
569568
assertEquals(0, loader.getCache().size());
570569

571570
loader.getSet(ENGLISH);
571+
Thread.sleep(1);
572572
assertEquals(1, loader.getCache().size());
573573

574574
loader.getSet(ENGLISH_AU);
575+
Thread.sleep(1);
575576
assertEquals(3, loader.getCache().size());
576577
assertNotNull(loader.getCache().getIfPresent(desc));
577578
assertNotNull(loader.getCache().getIfPresent(desc.getForOtherLanguage(ENGLISH_GB)));
578579
assertNotNull(loader.getCache().getIfPresent(desc.getForOtherLanguage(ENGLISH_AU)));
579580

580581
// Caffeine does not evict prior the threadshold, but after the size crossed
581582
loader.getSet(FRENCH);
582-
assertEquals(4, loader.getCache().size());
583+
Thread.sleep(1);
584+
assertEquals(3, loader.getCache().size());
583585
assertNotNull(loader.getCache().getIfPresent(desc.getForOtherLanguage(FRENCH)));
584586

585587
loader.getSet(GERMAN);
586-
assertEquals(4, loader.getCache().size());
588+
Thread.sleep(1);
589+
assertEquals(3, loader.getCache().size());
587590
assertNotNull(loader.getCache().getIfPresent(desc.getForOtherLanguage(GERMAN)));
588591
}
589592
}

0 commit comments

Comments
 (0)