You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2025/12/01 10:57:00 UTC
[jira] [Commented] (HDFS-17858) Fix TestDFSAdmin#testAllDatanodesReconfig fails
[ https://issues.apache.org/jira/browse/HDFS-17858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18041802#comment-18041802 ]
ASF GitHub Bot commented on HDFS-17858:
---------------------------------------
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 ended 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.
> 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: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org