YARN-8422. TestAMSimulator failing with NPE. Contributed by Giovanni Matteo Fumarola.
This commit is contained in:
parent
6e756e8a62
commit
c35481594f
@ -49,8 +49,8 @@ public class TestAMSimulator {
|
|||||||
private YarnConfiguration conf;
|
private YarnConfiguration conf;
|
||||||
private Path metricOutputDir;
|
private Path metricOutputDir;
|
||||||
|
|
||||||
private Class slsScheduler;
|
private Class<?> slsScheduler;
|
||||||
private Class scheduler;
|
private Class<?> scheduler;
|
||||||
|
|
||||||
@Parameterized.Parameters
|
@Parameterized.Parameters
|
||||||
public static Collection<Object[]> params() {
|
public static Collection<Object[]> params() {
|
||||||
@ -60,7 +60,7 @@ public static Collection<Object[]> params() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public TestAMSimulator(Class slsScheduler, Class scheduler) {
|
public TestAMSimulator(Class<?> slsScheduler, Class<?> scheduler) {
|
||||||
this.slsScheduler = slsScheduler;
|
this.slsScheduler = slsScheduler;
|
||||||
this.scheduler = scheduler;
|
this.scheduler = scheduler;
|
||||||
}
|
}
|
||||||
@ -115,7 +115,8 @@ private void verifySchedulerMetrics(String appId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void createMetricOutputDir() {
|
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 {
|
try {
|
||||||
metricOutputDir = Files.createTempDirectory(testDir, "output");
|
metricOutputDir = Files.createTempDirectory(testDir, "output");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -153,7 +154,9 @@ public void testAMSimulator() throws Exception {
|
|||||||
|
|
||||||
@After
|
@After
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
|
if (rm != null) {
|
||||||
rm.stop();
|
rm.stop();
|
||||||
|
}
|
||||||
|
|
||||||
deleteMetricOutputDir();
|
deleteMetricOutputDir();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user