File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 16
16
import static org .junit .Assert .assertNotNull ;
17
17
import static org .junit .Assert .assertTrue ;
18
18
19
+ import java .util .concurrent .TimeUnit ;
20
+
19
21
import org .eclipse .core .resources .IProject ;
20
22
import org .eclipse .core .resources .IResource ;
21
23
import org .eclipse .core .resources .IResourceChangeEvent ;
@@ -194,7 +196,17 @@ protected void deleteProject(String name) throws CoreException {
194
196
if (pro .exists ()) {
195
197
ResourceEventWaiter waiter = new ResourceEventWaiter (IPath .fromOSString (name ), IResourceChangeEvent .POST_CHANGE ,
196
198
IResourceDelta .CHANGED , 0 );
197
- pro .delete (IResource .FORCE | IResource .ALWAYS_DELETE_PROJECT_CONTENT , new NullProgressMonitor ());
199
+ try {
200
+ pro .delete (IResource .FORCE | IResource .ALWAYS_DELETE_PROJECT_CONTENT , new NullProgressMonitor ());
201
+ } catch (CoreException canNotDelete ) {
202
+ System .gc ();
203
+ try {
204
+ TimeUnit .MILLISECONDS .sleep (1 );
205
+ } catch (InterruptedException ignored ) {
206
+ }
207
+ // retry:
208
+ pro .delete (IResource .FORCE | IResource .ALWAYS_DELETE_PROJECT_CONTENT , new NullProgressMonitor ());
209
+ }
198
210
Object obj = waiter .waitForEvent ();
199
211
assertNotNull ("the project delete event did not arrive" , obj ); //$NON-NLS-1$
200
212
}
You can’t perform that action at this time.
0 commit comments