String actionId = addInitRecords(newHCatDependency);
checkCoordAction(actionId, newHCatDependency, CoordinatorAction.Status.WAITING);
new CoordPushDependencyCheckXCommand(actionId, true).call();
checkCoordAction(actionId, newHCatDependency1, CoordinatorAction.Status.WAITING);
PartitionDependencyManagerService pdms = Services.get().get(PartitionDependencyManagerService.class);
HCatAccessorService hcatService = Services.get().get(HCatAccessorService.class);
assertTrue(pdms.getWaitingActions(new HCatURI(newHCatDependency1)).contains(actionId));
assertTrue(hcatService.isRegisteredForNotification(new HCatURI(newHCatDependency1)));
// Timeout is 10 mins. Change action created time to before 12 min to make the action
// timeout.
long timeOutCreationTime = System.currentTimeMillis() - (12 * 60 * 1000);
setCoordActionCreationTime(actionId, timeOutCreationTime);
// Set some missing dependency. Instead of latest or future just setting a current one for testing as
// we are only interested in ensuring CoordActionInputCheckXCommand is run
setMissingDependencies(actionId, newHCatDependency + CoordELFunctions.INSTANCE_SEPARATOR + newHCatDependency3);
addPartition(db, table, "dt=20120430;country=brazil");
checkDependencies(actionId, newHCatDependency + CoordELFunctions.INSTANCE_SEPARATOR + newHCatDependency3,
newHCatDependency1);
new CoordPushDependencyCheckXCommand(actionId).call();
// Somehow with hive 0.10 it takes 1 second more.
Thread.sleep(1300);
checkDependencies(actionId, newHCatDependency3, "");
assertNull(pdms.getWaitingActions(new HCatURI(newHCatDependency1)));
assertFalse(hcatService.isRegisteredForNotification(new HCatURI(newHCatDependency1)));
}