From 5912370f16057a420111cd61ccc3802174365a45 Mon Sep 17 00:00:00 2001 From: Elon Azoulay Date: Sat, 16 Dec 2023 08:44:46 -0800 Subject: [PATCH] Reduce repetitions of testCreateFileRetry --- .../java/io/trino/filesystem/gcs/TestGcsFileSystemGcs.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/trino-filesystem-gcs/src/test/java/io/trino/filesystem/gcs/TestGcsFileSystemGcs.java b/lib/trino-filesystem-gcs/src/test/java/io/trino/filesystem/gcs/TestGcsFileSystemGcs.java index 852b30da274b..00f08df91377 100644 --- a/lib/trino-filesystem-gcs/src/test/java/io/trino/filesystem/gcs/TestGcsFileSystemGcs.java +++ b/lib/trino-filesystem-gcs/src/test/java/io/trino/filesystem/gcs/TestGcsFileSystemGcs.java @@ -38,8 +38,12 @@ void setup() @Test void testCreateFileRetry() { + // Note: this test is meant to expose flakiness + // Without retries it may fail non-deterministically. + // Retries are enabled in the default GcsFileSystemConfig. + // In practice this may happen between 7 and 20 retries. assertThatNoException().isThrownBy(() -> { - for (int i = 1; i <= 100; i++) { + for (int i = 1; i <= 30; i++) { TrinoOutputFile outputFile = getFileSystem().newOutputFile(getRootLocation().appendPath("testFile")); try (OutputStream out = outputFile.createOrOverwrite()) { out.write("test".getBytes(UTF_8));