|
@@ -731,9 +731,10 @@ public class TestLogAggregationService extends BaseContainerManagerTest {
|
|
this.conf.set(YarnConfiguration.NM_LOG_DIRS, localLogDir.getAbsolutePath());
|
|
this.conf.set(YarnConfiguration.NM_LOG_DIRS, localLogDir.getAbsolutePath());
|
|
this.conf.set(YarnConfiguration.NM_REMOTE_APP_LOG_DIR,
|
|
this.conf.set(YarnConfiguration.NM_REMOTE_APP_LOG_DIR,
|
|
this.remoteRootLogDir.getAbsolutePath());
|
|
this.remoteRootLogDir.getAbsolutePath());
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ DeletionService spyDelSrvc = spy(this.delSrvc);
|
|
LogAggregationService logAggregationService = spy(
|
|
LogAggregationService logAggregationService = spy(
|
|
- new LogAggregationService(dispatcher, this.context, this.delSrvc,
|
|
|
|
|
|
+ new LogAggregationService(dispatcher, this.context, spyDelSrvc,
|
|
super.dirsHandler));
|
|
super.dirsHandler));
|
|
logAggregationService.init(this.conf);
|
|
logAggregationService.init(this.conf);
|
|
logAggregationService.start();
|
|
logAggregationService.start();
|
|
@@ -741,6 +742,11 @@ public class TestLogAggregationService extends BaseContainerManagerTest {
|
|
ApplicationId appId =
|
|
ApplicationId appId =
|
|
BuilderUtils.newApplicationId(System.currentTimeMillis(),
|
|
BuilderUtils.newApplicationId(System.currentTimeMillis(),
|
|
(int) (Math.random() * 1000));
|
|
(int) (Math.random() * 1000));
|
|
|
|
+
|
|
|
|
+ File appLogDir =
|
|
|
|
+ new File(localLogDir, ConverterUtils.toString(appId));
|
|
|
|
+ appLogDir.mkdir();
|
|
|
|
+
|
|
Exception e = new RuntimeException("KABOOM!");
|
|
Exception e = new RuntimeException("KABOOM!");
|
|
doThrow(e)
|
|
doThrow(e)
|
|
.when(logAggregationService).createAppDir(any(String.class),
|
|
.when(logAggregationService).createAppDir(any(String.class),
|
|
@@ -759,9 +765,6 @@ public class TestLogAggregationService extends BaseContainerManagerTest {
|
|
};
|
|
};
|
|
checkEvents(appEventHandler, expectedEvents, false,
|
|
checkEvents(appEventHandler, expectedEvents, false,
|
|
"getType", "getApplicationID", "getDiagnostic");
|
|
"getType", "getApplicationID", "getDiagnostic");
|
|
- // filesystems may have been instantiated
|
|
|
|
- verify(logAggregationService).closeFileSystems(
|
|
|
|
- any(UserGroupInformation.class));
|
|
|
|
|
|
|
|
// verify trying to collect logs for containers/apps we don't know about
|
|
// verify trying to collect logs for containers/apps we don't know about
|
|
// doesn't blow up and tear down the NM
|
|
// doesn't blow up and tear down the NM
|
|
@@ -774,6 +777,10 @@ public class TestLogAggregationService extends BaseContainerManagerTest {
|
|
|
|
|
|
logAggregationService.stop();
|
|
logAggregationService.stop();
|
|
assertEquals(0, logAggregationService.getNumAggregators());
|
|
assertEquals(0, logAggregationService.getNumAggregators());
|
|
|
|
+ verify(spyDelSrvc).delete(eq(user), any(Path.class),
|
|
|
|
+ Mockito.<Path>anyVararg());
|
|
|
|
+ verify(logAggregationService).closeFileSystems(
|
|
|
|
+ any(UserGroupInformation.class));
|
|
}
|
|
}
|
|
|
|
|
|
private void writeContainerLogs(File appLogDir, ContainerId containerId,
|
|
private void writeContainerLogs(File appLogDir, ContainerId containerId,
|