lokeshj1703 commented on a change in pull request #2183:
URL: https://github.com/apache/ozone/pull/2183#discussion_r625695922
##########
File path:
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestBlockDeletingService.java
##########
@@ -713,9 +723,14 @@ public void testBlockThrottle() throws Exception {
// - current total space of container(it will be zero as all blocks
// in all the containers are deleted)).
deleteAndWait(service, 2);
- Assert.assertEquals(blocksPerContainer * containerCount * blockSpace,
- (totalContainerSpace - currentBlockSpace(containerData,
- containerCount)));
+
+ long totalContainerBlocks = blocksPerContainer*containerCount;
+ GenericTestUtils.waitFor(() ->
+ totalContainerBlocks*blockSpace ==
+ (totalContainerSpace-
+ currentBlockSpace(containerData,
containerCount)),
Review comment:
NIT. Same as above.
##########
File path:
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestBlockDeletingService.java
##########
@@ -447,6 +447,8 @@ public void testBlockDeletion() throws Exception {
// An interval will delete 1 * 2 blocks
deleteAndWait(svc, 1);
+ GenericTestUtils.waitFor(() ->
+ containerData.get(0).getBytesUsed() < 3, 100, 3000);
Review comment:
Unrelated to your changes. Can we set the block deletion limit to 2 at
line 401?
`dnConf.setBlockDeletionLimit(2);`
Then here we should check `containerData.get(0).getBytesUsed() == 100`
##########
File path:
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestBlockDeletingService.java
##########
@@ -702,9 +709,12 @@ public void testBlockThrottle() throws Exception {
// Deleted space of 10 blocks should be equal to (initial total space
// of container - current total space of container).
deleteAndWait(service, 1);
- Assert.assertEquals(blockLimitPerInterval * blockSpace,
- (totalContainerSpace - currentBlockSpace(containerData,
- containerCount)));
+
+ GenericTestUtils.waitFor(() ->
+ blockLimitPerInterval*blockSpace ==
+ (totalContainerSpace-
+ currentBlockSpace(containerData,
containerCount)),
+ 100, 3000);
Review comment:
Minor NIT: Space between `blockLimitPerInterval * blockSpace` and
`(totalContainerSpace -`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]