YARN-8422. TestAMSimulator failing with NPE. Contributed by Giovanni Matteo Fumarola.

(cherry picked from commit c35481594f)
This commit is contained in:
Inigo Goiri 2018-06-12 10:59:50 -07:00
parent d5cd12c082
commit 8be28376a9
1 changed files with 8 additions and 5 deletions

View File

@ -49,8 +49,8 @@ public class TestAMSimulator {
private YarnConfiguration conf;
private Path metricOutputDir;
private Class slsScheduler;
private Class scheduler;
private Class<?> slsScheduler;
private Class<?> scheduler;
@Parameterized.Parameters
public static Collection<Object[]> params() {
@ -60,7 +60,7 @@ public class TestAMSimulator {
});
}
public TestAMSimulator(Class slsScheduler, Class scheduler) {
public TestAMSimulator(Class<?> slsScheduler, Class<?> scheduler) {
this.slsScheduler = slsScheduler;
this.scheduler = scheduler;
}
@ -115,7 +115,8 @@ public class TestAMSimulator {
}
private void createMetricOutputDir() {
Path testDir = Paths.get(System.getProperty("test.build.data"));
Path testDir =
Paths.get(System.getProperty("test.build.data", "target/test-dir"));
try {
metricOutputDir = Files.createTempDirectory(testDir, "output");
} catch (IOException e) {
@ -153,7 +154,9 @@ public class TestAMSimulator {
@After
public void tearDown() {
rm.stop();
if (rm != null) {
rm.stop();
}
deleteMetricOutputDir();
}