addNodes(null, NUM_WATCHDOGS);
for (SgsTestNode node : additionalNodes) {
final long id = node.getDataService().getLocalNodeId();
txnScheduler.runTask(new TestAbstractKernelRunnable() {
public void run() throws Exception {
Node node = watchdogService.getNode(id);
if (node == null) {
fail("Expected node for ID " + id + " got " + node);
}
System.err.println(node);
if (id != node.getId()) {
fail("Expected node ID " + id +
" got, " + node.getId());
} else if (! node.isAlive()) {
fail("Node " + id + " is not alive!");
}
}
}, taskOwner);
}
// shutdown nodes...
if (additionalNodes != null) {
for (SgsTestNode node : additionalNodes) {
node.shutdown(false);
}
additionalNodes = null;
}
// wait for all nodes to fail...
Thread.sleep(renewTime * 4);
Set<Node> nodes = listener.getFailedNodes();
System.err.println("failedNodes: " + nodes);
if (nodes.size() != 5) {
fail("Expected 5 failed nodes, got " + nodes.size());
}
for (Node node : nodes) {
System.err.println(node);
if (node.isAlive()) {
fail("Node " + node.getId() + " is alive!");
}
}
}