[ 
https://issues.apache.org/jira/browse/HDFS-17858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18041659#comment-18041659
 ] 

ASF GitHub Bot commented on HDFS-17858:
---------------------------------------

ayushtkn commented on code in PR #8107:
URL: https://github.com/apache/hadoop/pull/8107#discussion_r2574332270


##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDFSAdmin.java:
##########
@@ -1249,8 +1249,15 @@ public void testAllDatanodesReconfig()
     when(reconfigurationUtil.parseChangedProperties(any(Configuration.class),
         any(Configuration.class))).thenReturn(changes);
 
-    int result = admin.startReconfiguration("datanode", "livenodes");
-    assertThat(result).isEqualTo(0);
+    LambdaTestUtils.await(1000, 50, () -> {
+      int result = admin.startReconfiguration("datanode", "livenodes");
+      assertThat(result).isEqualTo(0);
+      final List<String> outs = new ArrayList<>();
+      final List<String> errs = new ArrayList<>();
+      awaitReconfigurationFinished("datanode", "livenodes", outs, errs);
+      return errs.isEmpty();
+    });
+

Review Comment:
   in this logic we are doing `` admin.startReconfiguration("datanode", 
"livenodes");`` like in every iteration, we should just wait for the result and 
not perform any action, that changes the flow of the test





> Fix TestDFSAdmin#testAllDatanodesReconfig fails
> -----------------------------------------------
>
>                 Key: HDFS-17858
>                 URL: https://issues.apache.org/jira/browse/HDFS-17858
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 3.5.0
>            Reporter: caozhiqiang
>            Assignee: caozhiqiang
>            Priority: Major
>              Labels: pull-request-available
>
> TestDFSAdmin::testAllDatanodesReconfig() always failed because the last 
> startReconfiguration() need some time to finish.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to