Skip to content

Commit 8171b6a

Browse files
committed
Testing: reduce KEK cache timing threshold from 5x to 2x for CI stability
1 parent 98de98e commit 8171b6a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/test/java/com/wolfssl/provider/jce/test/WolfSSLKeyStoreTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2658,11 +2658,12 @@ public void testKekCacheInvalidateOnDeleteEntry() throws Exception {
26582658
long uncachedTime = System.currentTimeMillis() - start;
26592659
assertNotNull(key2Again);
26602660

2661-
/* Verify it was slower */
2661+
/* Verify it was slower. Use 2x threshold since timing can vary
2662+
* significantly on CI systems with fast storage. */
26622663
assertTrue("Cache should have been cleared, but timing suggests " +
26632664
"it wasn't (cached: " + cachedTime + "ms, uncached: " +
26642665
uncachedTime + "ms)",
2665-
uncachedTime > cachedTime * 5);
2666+
uncachedTime > cachedTime * 2);
26662667

26672668
} finally {
26682669
if (origEnabled != null) {
@@ -2715,11 +2716,12 @@ public void testKekCacheInvalidateOnSetKeyEntryOverwrite()
27152716
long uncachedTime = System.currentTimeMillis() - start;
27162717
assertNotNull(key2Again);
27172718

2718-
/* Verify it was slower */
2719+
/* Verify it was slower. Use 2x threshold since timing can vary
2720+
* significantly on CI systems with fast storage. */
27192721
assertTrue("Cache should have been cleared, but timing suggests " +
27202722
"it wasn't (cached: " + cachedTime + "ms, uncached: " +
27212723
uncachedTime + "ms)",
2722-
uncachedTime > cachedTime * 5);
2724+
uncachedTime > cachedTime * 2);
27232725

27242726
} finally {
27252727
if (origEnabled != null) {

0 commit comments

Comments
 (0)