diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/security/TestRootCARotationManager.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/security/TestRootCARotationManager.java index 7a770672d9c..27eaaaf62dc 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/security/TestRootCARotationManager.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/security/TestRootCARotationManager.java @@ -330,11 +330,12 @@ public void testPostProcessingCheck() throws Exception { () -> logs.getOutput().contains("isPostProcessing is true for"), 100, 20000); - GenericTestUtils.waitFor( - () -> logs.getOutput().contains("isPostProcessing is false"), - 100, 20000); doNothing().when(statefulServiceStateManager) .deleteConfiguration(Mockito.anyString()); + GenericTestUtils.waitFor( + () -> logs.getOutput().contains("isPostProcessing is false") && + logs.getOutput().contains("Stateful configuration is deleted"), + 100, 20000); verify(statefulServiceStateManager, times(1)) .deleteConfiguration(Mockito.anyString()); }