You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/12/14 04:53:17 UTC

[GitHub] [ozone] ayushtkn commented on a change in pull request #1697: HDDS-4013. FLAKY-UT: TestWatchForCommit#testWatchForCommitForGroupMismatchException

ayushtkn commented on a change in pull request #1697:
URL: https://github.com/apache/ozone/pull/1697#discussion_r542110687



##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/TestHelper.java
##########
@@ -234,12 +235,14 @@ public static void waitForPipelineClose(List<Pipeline> pipelineList,
 
     // wait for the pipeline to get destroyed in the datanodes
     for (Pipeline pipeline : pipelineList) {
+      HddsProtos.PipelineID pipelineId = pipeline.getId().getProtobuf();
       for (DatanodeDetails dn : pipeline.getNodes()) {
         XceiverServerSpi server =
             cluster.getHddsDatanodes().get(cluster.getHddsDatanodeIndex(dn))
                 .getDatanodeStateMachine().getContainer().getWriteChannel();
         Assert.assertTrue(server instanceof XceiverServerRatis);
-        server.removeGroup(pipeline.getId().getProtobuf());
+        GenericTestUtils.waitFor(() -> !server.isExist(pipelineId),
+            100, 30_000);

Review comment:
       Thanx @adoroszlai for the fix, I am able to repro this, changes seems fair enough.
   Does it makes sense to `removeGroup` explicitly in case `server.isExist(pipelineId)` is true, rather than waiting? Might speed up test? We can ignore the exception from `removeGroup` in the wait and retry to counter the race condition




----------------------------------------------------------------
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.

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