|
@@ -2276,7 +2276,7 @@ public class TestLogAggregationService extends BaseContainerManagerTest {
|
|
|
Records.newRecord(LogAggregationContext.class);
|
|
|
logAggregationContext.setLogAggregationPolicyClassName(
|
|
|
FailedOrKilledContainerLogAggregationPolicy.class.getName());
|
|
|
- verifySkipUnnecessaryNNOperations(logAggregationContext, 0, 2);
|
|
|
+ verifySkipUnnecessaryNNOperations(logAggregationContext, 0, 2, 0);
|
|
|
}
|
|
|
|
|
|
@Test (timeout = 20000)
|
|
@@ -2290,13 +2290,13 @@ public class TestLogAggregationService extends BaseContainerManagerTest {
|
|
|
AMOnlyLogAggregationPolicy.class.getName());
|
|
|
contextWithAMOnly.setRolledLogsIncludePattern("sys*");
|
|
|
contextWithAMOnly.setRolledLogsExcludePattern("std_final");
|
|
|
- verifySkipUnnecessaryNNOperations(contextWithAMOnly, 1, 4);
|
|
|
+ verifySkipUnnecessaryNNOperations(contextWithAMOnly, 1, 4, 1);
|
|
|
}
|
|
|
|
|
|
private void verifySkipUnnecessaryNNOperations(
|
|
|
LogAggregationContext logAggregationContext,
|
|
|
- int expectedLogAggregationTimes, int expectedAggregationReportNum)
|
|
|
- throws Exception {
|
|
|
+ int expectedLogAggregationTimes, int expectedAggregationReportNum,
|
|
|
+ int expectedCleanupOldLogsTimes) throws Exception {
|
|
|
LogAggregationService logAggregationService = new LogAggregationService(
|
|
|
dispatcher, this.context, this.delSrvc, super.dirsHandler);
|
|
|
logAggregationService.init(this.conf);
|
|
@@ -2307,7 +2307,7 @@ public class TestLogAggregationService extends BaseContainerManagerTest {
|
|
|
null, this.acls, logAggregationContext));
|
|
|
|
|
|
// Container finishes
|
|
|
- String[] logFiles = new String[] { "stdout" };
|
|
|
+ String[] logFiles = new String[] { "sysout" };
|
|
|
finishContainer(appId, logAggregationService,
|
|
|
ContainerType.APPLICATION_MASTER, 1, 0, logFiles);
|
|
|
AppLogAggregatorImpl aggregator =
|
|
@@ -2327,6 +2327,8 @@ public class TestLogAggregationService extends BaseContainerManagerTest {
|
|
|
aggregator.getLogAggregationTimes());
|
|
|
assertEquals(expectedAggregationReportNum,
|
|
|
this.context.getLogAggregationStatusForApps().size());
|
|
|
+ assertEquals(expectedCleanupOldLogsTimes,
|
|
|
+ aggregator.getCleanupOldLogTimes());
|
|
|
}
|
|
|
|
|
|
private int numOfLogsAvailable(LogAggregationService logAggregationService,
|