vaijosh commented on code in PR #7995:
URL: https://github.com/apache/hbase/pull/7995#discussion_r3055418544
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java:
##########
@@ -244,9 +244,10 @@ public void onLeak(String s, String s1) {
Mockito.verify(cache).shouldCacheBlock(Mockito.any(), Mockito.anyLong(),
Mockito.any());
Mockito.verify(cache, Mockito.never()).cacheBlock(Mockito.any(),
Mockito.any(),
Mockito.anyBoolean(), Mockito.anyBoolean());
- System.gc();
- Thread.sleep(1000);
- alloc.allocate(128 * 1024).release();
+ for (int i = 0; i < 15 && counter.get() == 0; i++) {
+ System.gc();
+ alloc.allocate(128 * 1024).release();
+ }
Review Comment:
@dParikesit
You have not added sleep inside the loop so it will finish quicky and
deafeat the purpose.
Please keep it something like below
for (int i = 0; i < 30 && counter.get() == 0; i++) {
System.gc();
alloc.allocate(128 * 1024).release();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
break;
}
}
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockIndex.java:
##########
@@ -258,9 +256,10 @@ public void onLeak(String s, String s1) {
try {
writeDataBlocksAndCreateIndex(hbw, outputStream, biw);
assertTrue(biw.getNumLevels() >= 3);
- System.gc();
- Thread.sleep(1000);
- allocator.allocate(128 * 1024).release();
+ for (int i = 0; i < 15 && counter.get() == 0; i++) {
+ System.gc();
+ allocator.allocate(128 * 1024).release();
+ }
Review Comment:
@dParikesit
Please add Put slip inside the loop and make 30 retries instead of 15
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]