8989import org .apache .hadoop .security .UserGroupInformation ;
9090import org .apache .hadoop .security .authorize .DefaultImpersonationProvider ;
9191import org .apache .hadoop .test .GenericTestUtils ;
92+ import org .apache .hadoop .test .LambdaTestUtils ;
9293import org .apache .hadoop .test .PathUtils ;
9394import org .apache .hadoop .util .Lists ;
9495import org .apache .hadoop .util .ToolRunner ;
@@ -1236,8 +1237,7 @@ public Integer run() throws Exception {
12361237
12371238 @ Test
12381239 @ Order (1 )
1239- public void testAllDatanodesReconfig ()
1240- throws IOException , InterruptedException , TimeoutException {
1240+ public void testAllDatanodesReconfig () throws Exception {
12411241 ReconfigurationUtil reconfigurationUtil = mock (ReconfigurationUtil .class );
12421242 cluster .getDataNodes ().get (0 ).setReconfigurationUtil (reconfigurationUtil );
12431243 cluster .getDataNodes ().get (1 ).setReconfigurationUtil (reconfigurationUtil );
@@ -1249,8 +1249,15 @@ public void testAllDatanodesReconfig()
12491249 when (reconfigurationUtil .parseChangedProperties (any (Configuration .class ),
12501250 any (Configuration .class ))).thenReturn (changes );
12511251
1252- int result = admin .startReconfiguration ("datanode" , "livenodes" );
1253- assertThat (result ).isEqualTo (0 );
1252+ LambdaTestUtils .await (1000 , 50 , () -> {
1253+ int result = admin .startReconfiguration ("datanode" , "livenodes" );
1254+ assertThat (result ).isEqualTo (0 );
1255+ final List <String > outs = new ArrayList <>();
1256+ final List <String > errs = new ArrayList <>();
1257+ awaitReconfigurationFinished ("datanode" , "livenodes" , outs , errs );
1258+ return errs .isEmpty ();
1259+ });
1260+
12541261 final List <String > outsForStartReconf = new ArrayList <>();
12551262 final List <String > errsForStartReconf = new ArrayList <>();
12561263 reconfigurationOutErrFormatter ("startReconfiguration" , "datanode" ,
0 commit comments