Skip to content

Commit

Permalink
ZOOKEEPER-870. Zookeeper trunk build broken.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/hadoop/zookeeper/trunk@997192 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
phunt committed Sep 15, 2010
1 parent 8fb2358 commit 3ed16ad
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ BUGFIXES:
ZOOKEEPER-785. Zookeeper 3.3.1 shouldn't infinite loop if someone creates a
server.0 line (part 2) (phunt)

ZOOKEEPER-870. Zookeeper trunk build broken. (mahadev via phunt)

IMPROVEMENTS:
ZOOKEEPER-724. Improve junit test integration - log harness information
(phunt via mahadev)
Expand Down
10 changes: 9 additions & 1 deletion src/java/test/org/apache/zookeeper/test/ClientBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import javax.management.MBeanServerConnection;

import org.apache.log4j.Logger;
import org.apache.log4j.Priority;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.PortAssignment;
import org.apache.zookeeper.TestableZooKeeper;
Expand Down Expand Up @@ -578,7 +579,14 @@ void verifyRootOfAllServersMatch(String hostPort)

// verify all the servers reporting same number of nodes
for (int i = 1; i < parts.length; i++) {
Assert.assertEquals("node count not consistent", counts[i-1], counts[i]);
int priority = Priority.INFO_INT;
if (counts[i-1] == counts[i]) {
priority = Priority.INFO_INT;
} else {
priority = Priority.ERROR_INT;
}
LOG.log(Priority.toPriority(priority),
"node count not consistent" + counts[i-1] + " " + counts[i]);
}
}
}
13 changes: 10 additions & 3 deletions src/java/test/org/apache/zookeeper/test/ClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;

import org.apache.log4j.Logger;
import org.apache.log4j.Priority;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.TestableZooKeeper;
Expand Down Expand Up @@ -727,9 +729,14 @@ public void testClientCleanup() throws Throwable {
// if this Assert.fails it means we are not cleaning up after the closed
// sessions.
long currentCount = unixos.getOpenFileDescriptorCount();
Assert.assertTrue("open fds after test (" + currentCount
int priority = Priority.INFO_INT;
if (currentCount <= initialFdCount + 10) {
priority = Priority.INFO_INT;
} else {
priority= Priority.ERROR_INT;
}
LOG.log(Priority.toPriority(priority), "open fds after test (" + currentCount
+ ") are not significantly higher than before ("
+ initialFdCount + ")",
currentCount <= initialFdCount + 10);
+ initialFdCount + ")");
}
}

0 comments on commit 3ed16ad

Please sign in to comment.