Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Brychcy2018-10-03 19:37:21 +0000
committerTill Brychcy2018-10-03 19:58:57 +0000
commitc6070d6b1f1f6e1dfc4aaf32ffa4b987394957ac (patch)
tree159ed4630d0dbab567c643c9fafea58b1434ac69
parent2a96da744d5fc9380433d64c4a71b4a5a8f15aab (diff)
downloadeclipse.jdt.core-c6070d6b1f1f6e1dfc4aaf32ffa4b987394957ac.tar.gz
eclipse.jdt.core-c6070d6b1f1f6e1dfc4aaf32ffa4b987394957ac.tar.xz
eclipse.jdt.core-c6070d6b1f1f6e1dfc4aaf32ffa4b987394957ac.zip
Bug 539767 - ClasspathInitializerTests - testBug525597B is a non
deterministic test and we see random failures Change-Id: I60b70fcf53383f7cfc24b767f4e40296e105b305
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java
index 4b6deb3715..38ebad03eb 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java
@@ -1801,6 +1801,8 @@ public void testBug525597B() throws CoreException {
Thread mainThread=Thread.currentThread();
Semaphore s1=new Semaphore(0);
Semaphore s2=new Semaphore(0);
+ Semaphore s3=new Semaphore(0);
+ Semaphore s4=new Semaphore(0);
AtomicReference<IJavaProject> p2Project=new AtomicReference<>();
ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P2", "/P1/lib.jar", "P3", "/P1/lib.jar"}) {
@@ -1815,6 +1817,12 @@ public void testBug525597B() throws CoreException {
// ignore
}
} else if (project.getElementName().equals("P3")) {
+ s3.release();
+ try {
+ s4.acquire(10000);
+ } catch (TimeOutException e) {
+ // ignore
+ }
if (JavaModelManager.getJavaModelManager().containerBeingInitializedGet(p2Project.get(),
containerPath) != null) {
p2Counter.incrementAndGet();
@@ -1826,6 +1834,12 @@ public void testBug525597B() throws CoreException {
// this point is reached when helperThread is also still waiting in P2
s2.release();
} else if (project.getElementName().equals("P3")) {
+ try {
+ s3.acquire(10000);
+ } catch (TimeOutException e) {
+ // ignore
+ }
+ s4.release();
if (JavaModelManager.getJavaModelManager().containerBeingInitializedGet(p2Project.get(),
containerPath) != null) {
p2Counter.incrementAndGet();

Back to the top