use of org.apache.tez.dag.history.DAGHistoryEvent in project tez by apache.
the class TestATSHistoryLoggingService method testNonSessionDomains.
@Test(timeout = 10000)
public void testNonSessionDomains() throws Exception {
when(historyACLPolicyManager.setupSessionACLs((Configuration) any(), (ApplicationId) any())).thenReturn(Collections.singletonMap(TezConfiguration.YARN_ATS_ACL_SESSION_DOMAIN_ID, "session-id"));
atsHistoryLoggingService.start();
verify(historyACLPolicyManager, times(1)).setupSessionACLs((Configuration) any(), (ApplicationId) any());
// Send the event and wait for completion.
TezDAGID dagId1 = TezDAGID.getInstance(appId, 0);
for (DAGHistoryEvent event : makeHistoryEvents(dagId1, atsHistoryLoggingService)) {
atsHistoryLoggingService.handle(event);
}
Thread.sleep(2500);
while (!atsHistoryLoggingService.eventQueue.isEmpty()) {
Thread.sleep(100);
}
// No dag domain were created.
verify(historyACLPolicyManager, times(0)).setupSessionDAGACLs((Configuration) any(), eq(appId), eq("0"), (DAGAccessControls) any());
// All calls made with session domain id.
verify(historyACLPolicyManager, times(6)).updateTimelineEntityDomain(any(), eq("session-id"));
}
Aggregations