Skip to content

Commit 7372e60

Browse files
committed
Clean up progress info items before and after ProgressTestCase
Improve tests isolation in order to prevent random test failures. Contributes to #370
1 parent 28f0a63 commit 7372e60

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/ProgressTestCase.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.eclipse.ui.IViewPart;
2424
import org.eclipse.ui.IWorkbenchPage;
2525
import org.eclipse.ui.IWorkbenchWindow;
26+
import org.eclipse.ui.internal.progress.FinishedJobs;
2627
import org.eclipse.ui.internal.progress.ProgressView;
2728
import org.eclipse.ui.tests.harness.util.UITestCase;
2829

@@ -42,6 +43,17 @@ public ProgressTestCase(String testName) {
4243
protected void doSetUp() throws Exception {
4344
super.doSetUp();
4445
window = openTestWindow("org.eclipse.ui.resourcePerspective");
46+
47+
// Remove progress info items before running the tests to prevent random
48+
// failings
49+
FinishedJobs.getInstance().clearAll();
50+
}
51+
52+
@Override
53+
protected void doTearDown() throws Exception {
54+
super.doTearDown();
55+
// Remove progress info items
56+
FinishedJobs.getInstance().clearAll();
4557
}
4658

4759
/**

0 commit comments

Comments
 (0)