Skip to content

Commit ce8ba36

Browse files
committed
Wait for auto-refresh at ClasspathTests.tearDown()
Fixes: eclipse-jdt#4903
1 parent 60dc2a2 commit ce8ba36

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4108,6 +4108,15 @@ public void waitForManualRefresh() {
41084108
} while (wasInterrupted);
41094109
}
41104110

4111+
public static void waitForAutoRefresh() throws CoreException {
4112+
try {
4113+
Job.getJobManager().wakeUp(ResourcesPlugin.FAMILY_AUTO_REFRESH);
4114+
Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_REFRESH, null);
4115+
} catch (OperationCanceledException | InterruptedException e) {
4116+
throw new CoreException(Status.error("Waiting on auto-refresh interrupted", e));
4117+
}
4118+
}
4119+
41114120
public static boolean isTouchJobRunning() {
41124121
Job[] jobs = Job.getJobManager().find(JavaModelManager.class);
41134122
for (Job job : jobs) {

org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public void setUpSuite() throws Exception {
9696
@Override
9797
protected void tearDown() throws Exception {
9898
try {
99+
waitForAutoRefresh();
99100
waitForAutoBuild();
100101
} finally {
101102
super.tearDown();

0 commit comments

Comments
 (0)