Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ private static Stream<ReplicationConfig> replicationConfigs() {

@ParameterizedTest
@MethodSource("replicationConfigs")
@Flaky("HDDS-8458")
public void testBlockDeletion(ReplicationConfig repConfig) throws Exception {
String volumeName = UUID.randomUUID().toString();
String bucketName = UUID.randomUUID().toString();
Expand Down Expand Up @@ -246,17 +245,20 @@ public void testBlockDeletion(ReplicationConfig repConfig) throws Exception {
Assertions.assertEquals(0L, metrics.getNumBlockDeletionTransactionSent());
// close the containers which hold the blocks for the key
OzoneTestUtils.closeAllContainers(scm.getEventQueue(), scm);
Thread.sleep(2000);
// make sure the containers are closed on the dn
omKeyLocationInfoGroupList.forEach((group) -> {
List<OmKeyLocationInfo> locationInfo = group.getLocationList();
locationInfo.forEach(
(info) -> cluster.getHddsDatanodes().get(0).getDatanodeStateMachine()
.getContainer().getContainerSet()
.getContainer(info.getContainerID()).getContainerData()
.setState(ContainerProtos.ContainerDataProto.State.CLOSED));
});

// If any container present as not closed, i.e. matches some entry
// not closed, then return false for wait
ContainerSet containerSet = cluster.getHddsDatanodes().get(0)
.getDatanodeStateMachine().getContainer().getContainerSet();
GenericTestUtils.waitFor(() -> {
return !(omKeyLocationInfoGroupList.stream().anyMatch((group) ->
group.getLocationList().stream().anyMatch((info) ->
containerSet.getContainer(info.getContainerID()).getContainerData()
.getState() != ContainerProtos.ContainerDataProto.State.CLOSED
)
));
}, 1000, 30000);

// The blocks should be deleted in the DN.
GenericTestUtils.waitFor(() -> {
try {
Expand Down