Skip to content

Commit

Permalink
Fix Random Failing UIEditWorkingSetWizardAuto.testEditPage eclipse-pl…
Browse files Browse the repository at this point in the history
…atform#275

In my experiments, the test failed in roughly 2% of runs.

The test didn't close all processes which potentially
accessed the files it contained.
This PR Makes the Job-Manager join all jobs before finally deleting the
project-root.

eclipse-platform#275
  • Loading branch information
Wittmaxi committed Apr 10, 2024
1 parent d1fbc3c commit ded182d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@

import java.util.ArrayList;
import java.util.List;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardDialog;
Expand Down Expand Up @@ -133,8 +134,9 @@ private void removeAllWorkingSets() {
}
}

private void cleanupWorkspace() {
private void cleanupWorkspace() throws OperationCanceledException {
try {
Job.getJobManager().cancel(null);
ResourcesPlugin.getWorkspace().getRoot().delete(true, null);
} catch (CoreException e) {
TestPlugin.getDefault().getLog().log(e.getStatus());
Expand Down

0 comments on commit ded182d

Please sign in to comment.