Skip to content

Commit b4ed81c

Browse files
arp7nandakumar131
authored andcommitted
HDDS-1332. Add some logging for flaky test testStartStopDatanodeStateMachine. Contributed by Arpit Agarwal. (#649)
1 parent b226958 commit b4ed81c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/DatanodeStateMachine.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,6 @@ public synchronized void stopDaemon() {
397397
@VisibleForTesting
398398
public boolean isDaemonStopped() {
399399
return this.executorService.isShutdown()
400-
&& this.getContext().getExecutionCount() == 0
401400
&& this.getContext().getState() == DatanodeStates.SHUTDOWN;
402401
}
403402

hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestDatanodeStateMachine.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
package org.apache.hadoop.ozone.container.common;
1818

19+
import com.google.common.base.Supplier;
1920
import com.google.common.collect.Maps;
2021
import com.google.common.util.concurrent.ThreadFactoryBuilder;
2122
import org.apache.hadoop.conf.Configuration;
@@ -165,8 +166,12 @@ public void testStartStopDatanodeStateMachine() throws IOException,
165166
stateMachine.startDaemon();
166167
SCMConnectionManager connectionManager =
167168
stateMachine.getConnectionManager();
168-
GenericTestUtils.waitFor(() -> connectionManager.getValues().size() == 1,
169-
1000, 30000);
169+
GenericTestUtils.waitFor(
170+
() -> {
171+
LOG.info("connectionManager.getValues().size() is {}",
172+
connectionManager.getValues().size());
173+
return connectionManager.getValues().size() == 1;
174+
}, 1000, 30000);
170175

171176
stateMachine.stopDaemon();
172177
assertTrue(stateMachine.isDaemonStopped());

0 commit comments

Comments
 (0)