HDDS-347. TestCloseContainerByPipeline#testCloseContainerViaStandaAlone sometimes fails. Contributed by Lixin Ge.
This commit is contained in:
parent
8dc07b4723
commit
f2315f2e9c
@ -182,9 +182,11 @@ public void testCloseContainerViaStandAlone()
|
|||||||
new CloseContainerCommand(containerID,
|
new CloseContainerCommand(containerID,
|
||||||
HddsProtos.ReplicationType.STAND_ALONE, pipeline.getId()));
|
HddsProtos.ReplicationType.STAND_ALONE, pipeline.getId()));
|
||||||
|
|
||||||
GenericTestUtils
|
// The log will appear after the state changed to closed in standalone,
|
||||||
.waitFor(() -> isContainerClosed(cluster, containerID, datanodeDetails),
|
// wait for the log to ensure the operation has been done.
|
||||||
500, 5 * 1000);
|
GenericTestUtils.waitFor(() -> logCapturer.getOutput().contains(
|
||||||
|
"submitting CloseContainer request over STAND_ALONE server for"
|
||||||
|
+ " container " + containerID), 500, 5 * 1000);
|
||||||
|
|
||||||
//double check if it's really closed (waitFor also throws an exception)
|
//double check if it's really closed (waitFor also throws an exception)
|
||||||
Assert.assertTrue(isContainerClosed(cluster, containerID, datanodeDetails));
|
Assert.assertTrue(isContainerClosed(cluster, containerID, datanodeDetails));
|
||||||
@ -260,7 +262,7 @@ private Boolean isContainerClosed(MiniOzoneCluster cluster, long containerID,
|
|||||||
containerData =
|
containerData =
|
||||||
datanodeService.getDatanodeStateMachine().getContainer()
|
datanodeService.getDatanodeStateMachine().getContainer()
|
||||||
.getContainerSet().getContainer(containerID).getContainerData();
|
.getContainerSet().getContainer(containerID).getContainerData();
|
||||||
return !containerData.isOpen();
|
return containerData.isClosed();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user