Skip to content

Commit bc8a22a

Browse files
committed
Retry presigned URI retrieval to retry on network issues
1 parent cdb2c8a commit bc8a22a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/trino-filesystem/src/test/java/io/trino/filesystem/AbstractTestTrinoFileSystem.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,12 +1053,13 @@ public void testPreSignedUris()
10531053
.preSignedUri(location, new Duration(1, SECONDS));
10541054

10551055
assertThat(directLocation).isPresent();
1056-
assertThat(retrieveUri(directLocation.get()))
1057-
.isEqualTo(TEST_BLOB_CONTENT_PREFIX + location);
1056+
1057+
assertEventually(new Duration(5, SECONDS), () -> assertThat(retrieveUri(directLocation.get()))
1058+
.isEqualTo(TEST_BLOB_CONTENT_PREFIX + location));
10581059

10591060
// Check if it can be retrieved more than once
1060-
assertThat(retrieveUri(directLocation.get()))
1061-
.isEqualTo(TEST_BLOB_CONTENT_PREFIX + location);
1061+
assertEventually(new Duration(5, SECONDS), () -> assertThat(retrieveUri(directLocation.get()))
1062+
.isEqualTo(TEST_BLOB_CONTENT_PREFIX + location));
10621063

10631064
// Check if after a timeout the pre-signed URI is no longer valid
10641065
assertEventually(new Duration(5, SECONDS), new Duration(1, SECONDS), () -> assertThatThrownBy(() -> retrieveUri(expiredDirectLocation.get()))

0 commit comments

Comments
 (0)