MasterRPC rpc = new DirectMasterRPC(master);
final FlumeNode node = new FlumeNode(rpc, false, false);
// should have nothing.
assertEquals(0, node.getLogicalNodeManager().getNodes().size());
LivenessManager liveMan = node.getLivenessManager();
// update config node to something that will be interrupted.
LOG.info("setting to invalid dfo host");
master.getSpecMan().setConfig(lnode, "flow", "asciisynth(0)",
"agentDFOSink(\"localhost\", 12345)");
master.getSpecMan().addLogicalNode(NetUtils.localhost(), lnode);
liveMan.heartbeatChecks();
LogicalNode n = node.getLogicalNodeManager().get(lnode);
Driver d = n.getDriver();
assertTrue("Attempting to start driver timed out",
d.waitForAtLeastState(DriverState.ACTIVE, 10000));
// update config node to something that will be interrupted.
LOG.info("!!! decommissioning node on master");
master.getSpecMan().removeLogicalNode(lnode);
// as node do heartbeat and update due to decommission
liveMan.heartbeatChecks();
LOG.info("!!! node should be decommissioning on node");
assertTrue("Attempting to decommission driver timed out",
d.waitForAtLeastState(DriverState.IDLE, 10000));
assertEquals("Only expected default logical node", 1, node