ctubbsii commented on a change in pull request #1556: WIP - Fixes #1488 - 
ManyWriteAheadLogsIT asserts open WALS equal to zero.
URL: https://github.com/apache/accumulo/pull/1556#discussion_r390655207
 
 

 ##########
 File path: 
test/src/main/java/org/apache/accumulo/test/functional/ManyWriteAheadLogsIT.java
 ##########
 @@ -198,16 +198,33 @@ public void testMany() throws Exception {
   }
 
   private void addOpenWals(ServerContext c, Set<String> allWalsSeen) throws 
Exception {
-    Map<String,WalState> wals = WALSunnyDayIT._getWals(c);
-    Set<Entry<String,WalState>> es = wals.entrySet();
+
     int open = 0;
-    for (Entry<String,WalState> entry : es) {
-      if (entry.getValue() == WalState.OPEN) {
-        open++;
-        allWalsSeen.add(entry.getKey());
+    int attempts = 0;
+    boolean foundWal = false;
+
+    while (open == 0) {
+      attempts++;
+      Map<String,WalState> wals = WALSunnyDayIT._getWals(c);
+      Set<Entry<String,WalState>> es = wals.entrySet();
+      for (Entry<String,WalState> entry : es) {
+        if (entry.getValue() == WalState.OPEN) {
+          open++;
+          allWalsSeen.add(entry.getKey());
+          foundWal = true;
+        } else {
+          log.error("The WalState is " + entry.getValue());// CLOSED or 
UNREFERENCED
 
 Review comment:
   The formatter will reform that line, and possibly others. Try running `mvn 
clean verify -DskipTests` on this branch to run the code formatter, and to 
check for other style issues.
   
   ```suggestion
             log.debug("The WalState for {} is {}", entry.getKey(), 
entry.getValue()); // CLOSED or UNREFERENCED
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to