This is an automated email from the ASF dual-hosted git repository.
yuqi4733 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new f9013ffee [#5213] fix(test): Increase the timeout to avoid flaky test
(#5613)
f9013ffee is described below
commit f9013ffee55392a991969d8ba7469cdc98ba5063
Author: Jerry Shao <[email protected]>
AuthorDate: Thu Nov 21 10:44:29 2024 +0800
[#5213] fix(test): Increase the timeout to avoid flaky test (#5613)
### What changes were proposed in this pull request?
Increase the timeout to avoid flaky issue.
### Why are the changes needed?
Previously we increased the retry times, but not timeout, we should
increase the timeout to make the test more robust.
Fix: #5213
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing UTs.
---------
Co-authored-by: Qi Yu <[email protected]>
---
.../java/org/apache/gravitino/catalog/hive/TestFetchFileUtils.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/catalogs/catalog-hive/src/test/java/org/apache/gravitino/catalog/hive/TestFetchFileUtils.java
b/catalogs/catalog-hive/src/test/java/org/apache/gravitino/catalog/hive/TestFetchFileUtils.java
index 31904e669..9ca344632 100644
---
a/catalogs/catalog-hive/src/test/java/org/apache/gravitino/catalog/hive/TestFetchFileUtils.java
+++
b/catalogs/catalog-hive/src/test/java/org/apache/gravitino/catalog/hive/TestFetchFileUtils.java
@@ -65,10 +65,10 @@ public class TestFetchFileUtils {
boolean success = false;
int attempts = 0;
- while (!success && attempts < MAX_RETRIES) {
+ while (!success) {
try {
LOG.info("Attempting to download file from URL: {} (Attempt {})",
fileUrl, attempts + 1);
- FetchFileUtils.fetchFileFromUri(fileUrl, destFile, 10, conf);
+ FetchFileUtils.fetchFileFromUri(fileUrl, destFile, 45, conf);
success = true;
LOG.info("File downloaded successfully on attempt {}", attempts + 1);
} catch (IOException e) {
@@ -76,7 +76,7 @@ public class TestFetchFileUtils {
LOG.error("Download attempt {} failed due to: {}", attempts,
e.getMessage(), e);
if (attempts < MAX_RETRIES) {
long retryDelay = INITIAL_RETRY_DELAY_MS * (1L << (attempts - 1));
- LOG.warn("Retrying in {}ms", retryDelay);
+ LOG.warn("Retrying in {} ms", retryDelay);
Thread.sleep(retryDelay);
} else {
throw new AssertionError("Failed to download file after " +
MAX_RETRIES + " attempts", e);