HDDS-1256. Fix failure in TestKeyValueContainerCheck. Contributed by Supratim Deka.

This commit is contained in:
Mukul Kumar Singh 2019-03-13 16:22:19 +05:30
parent 159a715eef
commit d602d462a6
1 changed files with 4 additions and 2 deletions

View File

@ -139,9 +139,11 @@ import static org.junit.Assert.assertTrue;
String strBlock = "block";
String strChunk = "-chunkFile";
byte[] chunkData = new byte[(int) chunkLen];
long totalBlks = normalBlocks + deletedBlocks;
containerData = new KeyValueContainerData(containerId,
(long) StorageUnit.MB.toBytes(chunksPerBlock * chunkLen),
(long) StorageUnit.BYTES.toBytes(
chunksPerBlock * chunkLen * totalBlks),
UUID.randomUUID().toString(), UUID.randomUUID().toString());
container = new KeyValueContainer(containerData, conf);
container.create(volumeSet, new RoundRobinVolumeChoosingPolicy(),
@ -156,7 +158,7 @@ import static org.junit.Assert.assertTrue;
assertTrue(chunksPath.listFiles().length == 0);
List<ContainerProtos.ChunkInfo> chunkList = new ArrayList<>();
for (int i = 0; i < (normalBlocks + deletedBlocks); i++) {
for (int i = 0; i < (totalBlks); i++) {
BlockID blockID = new BlockID(containerId, i);
BlockData blockData = new BlockData(blockID);