Skip to content

Commit b4d88f1

Browse files
authored
chore(java): attempt to reduce flaky CI failures (#2203)
1 parent fa1e151 commit b4d88f1

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/ci_test_vector_java.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ on:
2626
jobs:
2727
testJava:
2828
strategy:
29+
fail-fast: false
2930
matrix:
3031
library: [TestVectors]
3132
java-version: [8, 11, 17, 19]

DynamoDbEncryption/runtimes/java/src/test/sdkv1/com/amazonaws/services/dynamodbv2/datamodeling/encryption/providers/CachingMostRecentProviderTests.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,9 @@ public void testSingleVersion() throws InterruptedException {
190190
0,
191191
store.getVersionFromMaterialDescription(eMat2.getMaterialDescription())
192192
);
193-
// Let the TTL be exceeded
194-
Thread.sleep(500);
193+
// Let the TTL be exceeded; sleep must be > TTL (500ms) to reliably
194+
// land in the grace period and trigger a cache refresh.
195+
Thread.sleep(700);
195196
final EncryptionMaterials eMat3 = prov.getEncryptionMaterials(ctx);
196197
assertEquals(2, methodCalls.size());
197198
assertEquals(1, (int) methodCalls.getOrDefault("query", 0)); // To find current version
@@ -356,8 +357,9 @@ public void testTwoVersions() throws InterruptedException {
356357
"Expected no calls but was " + methodCalls.toString(),
357358
methodCalls.isEmpty()
358359
);
359-
// Let the TTL be exceeded
360-
Thread.sleep(500);
360+
// Let the TTL be exceeded; sleep must be > TTL (500ms) to reliably
361+
// land in the grace period and trigger a cache refresh.
362+
Thread.sleep(700);
361363
final EncryptionMaterials eMat3 = prov.getEncryptionMaterials(ctx);
362364

363365
assertEquals(1, (int) methodCalls.getOrDefault("query", 0)); // To find current version
@@ -512,8 +514,9 @@ public void testSingleVersionTwoMaterials() throws InterruptedException {
512514
store.getVersionFromMaterialDescription(eMat2_2.getMaterialDescription())
513515
);
514516

515-
// Let the TTL be exceeded
516-
Thread.sleep(500);
517+
// Let the TTL be exceeded; sleep must be > TTL (500ms) to reliably
518+
// land in the grace period and trigger a cache refresh.
519+
Thread.sleep(700);
517520
final EncryptionMaterials eMat3_1 = prov.getEncryptionMaterials(ctx1);
518521
assertEquals(2, methodCalls.size());
519522
assertEquals(1, (int) methodCalls.get("query")); // To find current version

0 commit comments

Comments
 (0)