You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "mladjan-gadzic (via GitHub)" <gi...@apache.org> on 2023/05/18 11:41:27 UTC

[GitHub] [ozone] mladjan-gadzic opened a new pull request, #4732: HDDS-7889. Intermittent failure in TestOzoneSnapshotRestore

mladjan-gadzic opened a new pull request, #4732:
URL: https://github.com/apache/ozone/pull/4732

   ## What changes were proposed in this pull request?
   The issue was that `TestOzoneSnapshotRestore::keyCopy` method was not finished copying keys when assertion for return value of `TestOzoneSnapshotRestore::keyCount` method was executed. It is proposed to use `GenericTestUtils::waitFor` to wait for `TestOzoneSnapshotRestore::keyCount` to return expected number of keys. For more info check comment section under linked Jira ticket.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-7889
   
   ## How was this patch tested?
   * unit tests
   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] mladjan-gadzic commented on a diff in pull request #4732: HDDS-7889. Intermittent failure in TestOzoneSnapshotRestore

Posted by "mladjan-gadzic (via GitHub)" <gi...@apache.org>.
mladjan-gadzic commented on code in PR #4732:
URL: https://github.com/apache/ozone/pull/4732#discussion_r1197759098


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java:
##########
@@ -332,7 +342,12 @@ public void testRestoreSnapshotDifferentBucketLayout(
       keyCopy(sourcePath + keyPrefix + i, destPath);
     }
 
-    int finalKeyCount = keyCount(buck2, keyPrefix);
-    Assertions.assertEquals(5, finalKeyCount);
+    GenericTestUtils.waitFor(() -> {
+      try {
+        return 5 == keyCount(buck2, keyPrefix);
+      } catch (IOException e) {
+        return false;
+      }
+    }, 1000, 10000);

Review Comment:
   Yup, makes perfect sense. Will do that.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] mladjan-gadzic commented on pull request #4732: HDDS-7889. Intermittent failure in TestOzoneSnapshotRestore

Posted by "mladjan-gadzic (via GitHub)" <gi...@apache.org>.
mladjan-gadzic commented on PR #4732:
URL: https://github.com/apache/ozone/pull/4732#issuecomment-1552987476

   @adoroszlai thanks for the review! 
   
   > Please run the test repeatedly in CI (see https://github.com/apache/ozone/commit/aaa6e8be3ccf6d47d3dd93750757c13e286fa374 for an example) and post the results.
   
   I've been running those kind of tests for a quite some time. Please check [https://github.com/mladjan-gadzic/ozone/actions/workflows/HDDS-7889.yml](https://github.com/mladjan-gadzic/ozone/actions/workflows/HDDS-7889.yml). There has not been a single failure since the last commit. Is that what you are referring to?


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on a diff in pull request #4732: HDDS-7889. Intermittent failure in TestOzoneSnapshotRestore

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #4732:
URL: https://github.com/apache/ozone/pull/4732#discussion_r1197749250


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java:
##########
@@ -332,7 +342,12 @@ public void testRestoreSnapshotDifferentBucketLayout(
       keyCopy(sourcePath + keyPrefix + i, destPath);
     }
 
-    int finalKeyCount = keyCount(buck2, keyPrefix);
-    Assertions.assertEquals(5, finalKeyCount);
+    GenericTestUtils.waitFor(() -> {
+      try {
+        return 5 == keyCount(buck2, keyPrefix);
+      } catch (IOException e) {
+        return false;
+      }
+    }, 1000, 10000);

Review Comment:
   Can you please extract the duplicated code into a method `waitForKeyCount`?



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on pull request #4732: HDDS-7889. Intermittent failure in TestOzoneSnapshotRestore

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #4732:
URL: https://github.com/apache/ozone/pull/4732#issuecomment-1553019687

   > I've been running those kind of tests for a quite some time. Please check https://github.com/mladjan-gadzic/ozone/actions/workflows/HDDS-7889.yml. There has not been a single failure since the last commit. Is that what you are referring to?
   
   Yes, great work, thanks for the link.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai merged pull request #4732: HDDS-7889. Intermittent failure in TestOzoneSnapshotRestore

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #4732:
URL: https://github.com/apache/ozone/pull/4732


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] mladjan-gadzic commented on pull request #4732: HDDS-7889. Intermittent failure in TestOzoneSnapshotRestore

Posted by "mladjan-gadzic (via GitHub)" <gi...@apache.org>.
mladjan-gadzic commented on PR #4732:
URL: https://github.com/apache/ozone/pull/4732#issuecomment-1553326341

   Thanks @adoroszlai for the review!


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org