jerryshao commented on code in PR #4511:
URL: https://github.com/apache/gravitino/pull/4511#discussion_r1718063564


##########
catalogs/catalog-hive/src/test/java/org/apache/gravitino/catalog/hive/TestFetchFileUtils.java:
##########
@@ -43,9 +46,29 @@ public void testLinkLocalFile() throws Exception {
   @Test
   public void testDownloadFromHTTP() throws Exception {
     File destFile = new File("dest");
-    FetchFileUtils.fetchFileFromUri(
-        "https://downloads.apache.org/hadoop/common/KEYS";, destFile, 10, new 
Configuration());
-    Assertions.assertTrue(destFile.exists());
+    String fileUrl = "https://downloads.apache.org/hadoop/common/KEYS";;
+    Configuration conf = new Configuration();
+
+    boolean success = false;
+    int attempts = 0;
+
+    while (!success && attempts < MAX_RETRIES) {
+      try {
+        FetchFileUtils.fetchFileFromUri(fileUrl, destFile, 10, conf);
+        success = true;
+      } catch (IOException e) {
+        attempts++;
+        if (attempts < MAX_RETRIES) {
+          System.out.println(
+              "Attempt " + attempts + " failed. Retrying in " + RETRY_DELAY_MS 
+ "ms.");

Review Comment:
   We don't allow to use `println`, please use log4j or remove this line.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to