accumulo-dev mailing list archives

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

    https://github.com/apache/accumulo/pull/128#discussion_r71248001
  
    --- 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 --
    
    Can you clarify what you are asking here @joshelser?  I replaced existing asserts like
the following
    
    assertEquals(wals.toString(), 2, wals.size());
    
    with this new method named getWALsAndAssertCount.  I still think it is an assert, just
an assert that tries extra hard to pass.


---
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