Skip to content

Commit

Permalink
ResourceInitialSelectionTest: fix deleting resources #294
Browse files Browse the repository at this point in the history
Concurrent "Decoration Calculation" sometimes prevented Project from
deleting on Windows OS.

#294
  • Loading branch information
EcljpseB0T committed Oct 2, 2024
1 parent 2cab7ac commit e3abf56
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.FilteredResourcesSelectionDialog;
import org.eclipse.ui.internal.decorators.DecoratorManager;
import org.eclipse.ui.tests.harness.util.DisplayHelper;
import org.eclipse.ui.tests.harness.util.UITestCase;
import org.junit.Test;
Expand Down Expand Up @@ -381,6 +383,8 @@ protected void doTearDown() throws Exception {
}
if (project != null) {
try {
Job.getJobManager().wakeUp(DecoratorManager.FAMILY_DECORATE);
Job.getJobManager().join(DecoratorManager.FAMILY_DECORATE, null);
project.delete(true, null);
} catch (Exception e) {
// try to get a stacktrace which jobs still has project open so that it can not
Expand Down

0 comments on commit e3abf56

Please sign in to comment.