lfxy commented on code in PR #8107:
URL: https://github.com/apache/hadoop/pull/8107#discussion_r2576598141
##########
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:
We cannot determine whether the reconfiguration has finished based on the
return value of admin.startReconfiguration(), because even if it returns 0, the
datanode's reconfig thread may not have finished. We need to actively get the
reconfiguration status using getReconfigurationStatus, to wait reconfiguration
finished.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]