* This test differs from the previous by having an bad dns name/request that
* will eventually fail (ubuntu/java1.6 takes about 10s)
*/
@Test
public void testActiveE2ECloseBadDNS() throws InterruptedException {
final FlumeMaster master = new FlumeMaster(cfg);
MasterRPC rpc = new DirectMasterRPC(master);
final FlumeNode node = new FlumeNode(rpc, false, false);
// should have nothing.
assertEquals(0, node.getLogicalNodeManager().getNodes().size());
final CountDownLatch done = new CountDownLatch(1);
new Thread() {
public void run() {
LivenessManager liveMan = node.getLivenessManager();
try {
// update config node to something that will be interrupted.
LOG.info("setting to invalid dfo host");
master.getSpecMan().setConfig("node1", "flow", "asciisynth(0)",
"agentE2ESink(\"localhost\", 12345)");
master.getSpecMan().addLogicalNode(NetUtils.localhost(), "node1");
liveMan.heartbeatChecks();
Thread.sleep(15000); // Takes 10s for dns to fail
// update config node to something that will be interrupted.
LOG.info("!!! decommissioning node on master");
master.getSpecMan().removeLogicalNode("node1");
liveMan.heartbeatChecks();
LOG.info("!!! node should be decommissioning on node");
} catch (Exception e) {
LOG.error("closed caused an error out: " + e.getMessage(), e);