Not sure if this helps but I had what I believe to be similar issues (maybe there is more detail there [1]) a while back without much feedback at the time.
My thinking at the time may have been because of the "gradle daemon" [2] [3] in use in some contexts (i.e. travis CI builds; switching between java version sub-tests, etc.), that there may have been some files locked by the daemon or a daemon with differe java version preventing some activities elsewhere. But I'm not sure as I'm no expert. Eric Bresie [email protected] Reference (1) https://lists.apache.org/thread/rx46cgwy0t44z0dyw5ylb524djj9g20c (2) https://lists.apache.org/thread/76jwd8ov418chnkxy2x0k7819qgxqstj (3) https://lists.apache.org/thread/5nd3kbr53qql0dopxcyg2h40dskfcnn2 On Sun, Dec 19, 2021 at 8:03 AM Matthias Bläsing <[email protected]> wrote: > Hi, > > it would be great if someone with more insight into the project > infrastructure of NetBeans, especially with Gradle, could have a look > at the unittest > org.netbeans.modules.gradle.java.classpath.ClassPathProviderImplTest > > When I run it manually, I get failures every 5-10 runs on JDK 8 in > testCompilePreTrusted. If I switch testing to JDK 11, I get the same > error every time. The error can be reproduced even if the test method > is ran in isolation. > > The logs are not to helpful (identical between successful and failing > run). > > I modified the test like this (reporting the detected quality in the > fal message): > > ----------------------------------------------------------------- > > --- > a/java/gradle.java/test/unit/src/org/netbeans/modules/gradle/java/classpath/ClassPathProviderImplTest.java > +++ > b/java/gradle.java/test/unit/src/org/netbeans/modules/gradle/java/classpath/ClassPathProviderImplTest.java > @@ -36,6 +36,7 @@ > import org.netbeans.modules.gradle.AbstractGradleProjectTestCase; > import org.netbeans.modules.gradle.ProjectTrust; > import org.netbeans.modules.gradle.api.NbGradleProject; > +import org.netbeans.modules.gradle.api.NbGradleProject.Quality; > import org.netbeans.modules.gradle.java.api.GradleJavaProject; > import org.netbeans.spi.java.classpath.ClassPathProvider; > import org.netbeans.spi.project.ActionProgress; > @@ -249,7 +250,8 @@ > FileObject j2 = s.getFileObject("src/main/java/test/App.java"); > > NbGradleProject ngp = NbGradleProject.get(prj2); > - assertTrue("Closed project should be at least EVALUATED", > ngp.getQuality().atLeast(NbGradleProject.Quality.EVALUATED)); > + Quality evaluatedQuality = ngp.getQuality(); > + assertTrue("Closed project should be at least EVALUATED, but was: > " + evaluatedQuality, > evaluatedQuality.atLeast(NbGradleProject.Quality.EVALUATED)); > > ClassPath cp = ClassPath.getClassPath(j2, ClassPath.COMPILE); > assertFalse("Cached project must know its COMPILE path", > cp.getRoots().length == 0); > > ----------------------------------------------------------------- > > With that I get: > > Testcase: > testCompilePreTrusted(org.netbeans.modules.gradle.java.classpath.ClassPathProviderImplTest): > FAILED > Closed project should be at least EVALUATED, but was: FALLBACK > junit.framework.AssertionFailedError: Closed project should be at least > EVALUATED, but was: FALLBACK > at > org.netbeans.modules.gradle.java.classpath.ClassPathProviderImplTest.testCompilePreTrusted(ClassPathProviderImplTest.java:254) > at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:77) > at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:476) > at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:402) > at java.lang.Thread.run(Thread.java:748) > > Given the comments about a cache, we might see a cached version, which > is in the closed state. > > Thank you > > Matthias > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > For further information about the NetBeans mailing lists, visit: > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > >
