steveloughran commented on code in PR #5176: URL: https://github.com/apache/hadoop/pull/5176#discussion_r1040769983
########## hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestAbfsInputStream.java: ########## @@ -524,30 +527,33 @@ public void testStreamPurgeDuringReadAheadCallExecuting() throws Exception { final ReadBufferManager readBufferManager = ReadBufferManager.getBufferManager(); + final int readBufferTotal = readBufferManager.getNumBuffers(); + //Sleeping to give ReadBufferWorker to pick the readBuffers for processing. - Thread.sleep(1_000L); + Thread.sleep(readBufferTransferToInProgressProbableTime); Assertions.assertThat(readBufferManager.getInProgressCopiedList()) - .describedAs("InProgressList should have 3 elements") - .hasSize(3); + .describedAs("InProgressList should have " + readBufferQueuedCount + " elements") + .hasSize(readBufferQueuedCount); + final int freeListBufferCount = readBufferTotal - readBufferQueuedCount; Assertions.assertThat(readBufferManager.getFreeListCopy()) - .describedAs("FreeList should have 13 elements") - .hasSize(13); + .describedAs("FreeList should have " + freeListBufferCount + "elements") Review Comment: you can actually use string.format patterns here; most relevant for on demand toString calls which are more expensive. I'm not worrying about it here though -- 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: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org