Open merks opened 2 years ago
Adding this seems to do the trick. @iloveeclipse Does this seem like the right thing to do?
protected void deployLeakTest(String sourcename, boolean incremantal) {
try {
IPath path = WORKSPACE_PATH.append(sourcename);
createWorkspaceFile(path, TestSuiteHelper.getPluginDirectoryPath().append(TEST_SOURCE_ROOT).append(getTestSourcePath()).append(sourcename));
if (incremantal) {
incrementalBuild();
} else {
fullBuild();
}
Job.getJobManager().join(ApiAnalysisBuilder.ApiAnalysisJob.class, null); // <<<<<<<<<
expectingNoJDTProblemsFor(path);
ApiProblem[] problems = getEnv().getProblemsFor(path, null);
assertProblems(problems);
} catch (Exception e) {
fail(e.getMessage());
}
}
The API analysis shouldn't run in a job during tests, see org.eclipse.pde.api.tools.builder.tests.ApiBuilderTest.beforeClass()
Does this seem like the right thing to do?
I assume MethodReturnTypeLeak
should be converted to JUnit 4+ where BeforeClass
is respected.
Something like that because that method isn't invoked otherwise...
While testing some changes I'm making, I was confused by the test failures (failure to find API problems) until I noticed that while the "full" build is completed, the actual job doing the API analysis is blocked because I set a break point there. So the test completes/fails without finding expected problems while I think it should be waiting for the analysis to complete...
It seems to me just asking for problems on a build machine where the API analysis might sometimes not be done...