Stage s = getStageWithServerAction(1, 977, hostname, payload, "test");
stages.add(s);
db.persistActions(stages);
ActionScheduler scheduler = new ActionScheduler(100, 50, db, aq, fsm, 3,
new HostsMap((String) null), new ServerActionManagerImpl(fsm), unitOfWork);
scheduler.start();
while (!stages.get(0).getHostRoleStatus(hostname, "AMBARI_SERVER_ACTION")
.equals(HostRoleStatus.COMPLETED)) {
Thread.sleep(100);
}
scheduler.stop();
assertEquals(stages.get(0).getHostRoleStatus(hostname, "AMBARI_SERVER_ACTION"),
HostRoleStatus.COMPLETED);
stages = new ArrayList<Stage>();
payload.remove(ServerAction.PayloadName.CLUSTER_NAME);
s = getStageWithServerAction(1, 23, hostname, payload, "test");
stages.add(s);
db.persistActions(stages);
scheduler = new ActionScheduler(100, 50, db, aq, fsm, 3,
new HostsMap((String) null), new ServerActionManagerImpl(fsm), unitOfWork);
scheduler.start();
while (!stages.get(0).getHostRoleStatus(hostname, "AMBARI_SERVER_ACTION")
.equals(HostRoleStatus.FAILED)) {
Thread.sleep(100);