* that node is decommissioned. As part of decommissioning, the act of closing
* the E2E agent should not hang the node.
*/
@Test
public void testActiveE2EClose() 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("TestDiskFailoverAgent") {
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(10000);
// 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);