Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/128#discussion_r71260153
  
    --- Diff: 
test/src/main/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java ---
    @@ -232,4 +216,53 @@ private void writeSomeData(Connector conn, String 
tableName, int row, int col) t
         return result;
       }
     
    +  private final int TIMES_TO_COUNT = 20;
    +  private final int PAUSE_BETWEEN_COUNTS = 100;
    +
    +  private Map<String,Boolean> getWALsAndAssertCount(Connector c, int 
expectedCount) throws Exception {
    +    // see https://issues.apache.org/jira/browse/ACCUMULO-4110. Sometimes 
this test counts the logs before
    +    // the new standby log is actually ready. So let's try a few times 
before failing, returning the last
    +    // wals variable with the the correct count.
    +    Map<String,Boolean> wals = _getWals(c);
    +    if (wals.size() == expectedCount) {
    +      return wals;
    +    }
    +
    +    int waitLonger = getWaitFactor();
    +    for (int i = 1; i <= TIMES_TO_COUNT; i++) {
    +      Thread.sleep(i * PAUSE_BETWEEN_COUNTS * waitLonger);
    +      wals = _getWals(c);
    +      if (wals.size() == expectedCount) {
    +        return wals;
    +      }
    +    }
    +
    +    fail("Unable to get the correct number of WALs, expected " + 
expectedCount + " but got " + wals.toString());
    --- End diff --
    
    I am suggesting that you remove the line this comment is on (the 
`fail(..)`) and the return of an empty hashmap you have after that. If we exit 
the above for-loop, just `return wals;`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to