accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshelser <...@git.apache.org>
Subject [GitHub] accumulo pull request #128: ACCUMULO-4110 clean up the WALSunnyDayIT
Date Mon, 18 Jul 2016 23:05:11 GMT
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/128#discussion_r71247211
  
    --- 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 --
    
    Would recommend removing this fail and let it bubble up to the caller. Let them decide
what to do when they don't get the expected number of 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message