ctubbsii commented on code in PR #3508:
URL: https://github.com/apache/accumulo/pull/3508#discussion_r1237797250
##########
test/src/main/java/org/apache/accumulo/test/functional/MemoryStarvedScanIT.java:
##########
@@ -392,21 +489,28 @@ public void testBatchScanPauses() throws Exception {
assertEquals(currentCount, fetched.get());
assertTrue(SCAN_START_DELAYED.doubleValue() >= paused);
assertEquals(returned, SCAN_RETURNED_EARLY.doubleValue());
- assertEquals(1, LOW_MEM_DETECTED.get());
+ // check across multiple low memory checks and metric updates that low
memory detected
+ // remains set
+ int checkCount = 6;
+ while (checkCount-- > 0) {
Review Comment:
This currently runs 6 times (5, 4, 3, 2, 1, 0). It seems like you intended
it to run 5 times (5, 4, 3, 2, 1), or maybe (4, 3, 2, 1, 0)?.
```suggestion
while (--checkCount > 0) {
```
You could also be more explicit about the range you want to iterate over by
using IntStream and forEach:
```java
IntStream.rangeClosed(1, 5).map(i -> 6-i).forEach(System.out::println); // or
IntStream.rangeClosed(-5, -1).map(i -> -i).forEach(System.out::println);
```
That example goes backwards, like yours, but it's easier to go forwards.
--
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]