Skip to content

Commit

Permalink
Replace calls to ResourceTest.cleanup()
Browse files Browse the repository at this point in the history
Some test classes manually call the cleanup() method of ResourceTest
just to remove the projects in the workspace. Since this method contains
more functionality than that and should be private to the ResourceTest
teardown functionality, this change replaces the calls to the method
with ordinary cleanups of the workspace.
  • Loading branch information
HeikoKlare committed Nov 30, 2023
1 parent 9b9ddbf commit 76ee2ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ protected void setUp() throws Exception {
@Override
protected void tearDown() throws Exception {
// Cleanup workspace first to ensure that auto-build is not started on projects
cleanup();
waitForBuild();
getWorkspace().getRoot().delete(true, true, getMonitor());
super.tearDown();
TimerBuilder.abortCurrentBuilds();
}
Expand Down Expand Up @@ -143,7 +144,7 @@ public void testIndividualProjectBuilds_ProjectRelaxedRule() throws Exception {

@Test
public void testIndividualProjectBuilds_WithManyProjects_ProjectRelaxedRule() throws Exception {
int numberOfParallelBuilds = 60;
int numberOfParallelBuilds = 30;
var longRunningProjects = createMultipleTestProjects(numberOfParallelBuilds, BuildDurationType.LONG_RUNNING,
RuleType.CURRENT_PROJECT_RELAXED);
executeIndividualFullProjectBuilds(numberOfParallelBuilds, () -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ protected void reinitializeProjectsAfterTestIteration() {
public void cleanUp(Object[] args, int countArg) throws Exception {
// Reinitialize projects if necessary
if (reinitializeOnCleanup) {
IResourceTest.this.cleanup();
waitForBuild();
getWorkspace().getRoot().delete(true, true, getMonitor());
IResourceTest.this.initializeProjects();
reinitializeOnCleanup = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ public IResource[] buildResources(IContainer root, String[] hierarchy) {
return result;
}

protected void cleanup() throws CoreException {
private void cleanup() throws CoreException {
// Wait for any build job that may still be executed
waitForBuild();
final IFileStore[] toDelete = storesToDelete.toArray(new IFileStore[0]);
Expand Down

0 comments on commit 76ee2ef

Please sign in to comment.