diff options
author | Till Brychcy | 2018-10-03 19:37:21 +0000 |
---|---|---|
committer | Till Brychcy | 2018-10-03 19:58:57 +0000 |
commit | c6070d6b1f1f6e1dfc4aaf32ffa4b987394957ac (patch) | |
tree | 159ed4630d0dbab567c643c9fafea58b1434ac69 | |
parent | 2a96da744d5fc9380433d64c4a71b4a5a8f15aab (diff) | |
download | eclipse.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.java | 14 |
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(); |