Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.authorize.DefaultImpersonationProvider;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.LambdaTestUtils;
import org.apache.hadoop.test.PathUtils;
import org.apache.hadoop.util.Lists;
import org.apache.hadoop.util.ToolRunner;
Expand Down Expand Up @@ -1236,8 +1237,7 @@ public Integer run() throws Exception {

@Test
@Order(1)
public void testAllDatanodesReconfig()
throws IOException, InterruptedException, TimeoutException {
public void testAllDatanodesReconfig() throws Exception {
ReconfigurationUtil reconfigurationUtil = mock(ReconfigurationUtil.class);
cluster.getDataNodes().get(0).setReconfigurationUtil(reconfigurationUtil);
cluster.getDataNodes().get(1).setReconfigurationUtil(reconfigurationUtil);
Expand All @@ -1251,6 +1251,18 @@ public void testAllDatanodesReconfig()

int result = admin.startReconfiguration("datanode", "livenodes");
assertThat(result).isEqualTo(0);
LambdaTestUtils.await(10000, 100, () -> {
List<String> outs = new ArrayList<>();
List<String> errs = new ArrayList<>();
try {
getReconfigurationStatus("datanode", "livenodes", outs, errs);
} catch (IOException | InterruptedException e) {
LOG.error(String.format(
"call getReconfigurationStatus on datanode[livenodes] failed."), e);
}
return !outs.isEmpty() && outs.get(0).contains("finished");
});

Copy link
Contributor Author

@lfxy lfxy Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ayushtkn The test has passed. Do you agree with this modification? Also, is it possible to replace LambdaTestUtils.await() with awaitReconfigurationFinished(), since their logic is the same?

final List<String> outsForStartReconf = new ArrayList<>();
final List<String> errsForStartReconf = new ArrayList<>();
reconfigurationOutErrFormatter("startReconfiguration", "datanode",
Expand Down