Scott Murphy Heiberg created GROOVY-12527:
---------------------------------------------

             Summary: testSelfReferentialTypeParameter5 can fail when 
GenericsSTCTest and GenericsStaticCompileTest grab into the same empty grape 
cache
                 Key: GROOVY-12527
                 URL: https://issues.apache.org/jira/browse/GROOVY-12527
             Project: Groovy
          Issue Type: Test
          Components: build
            Reporter: Scott Murphy Heiberg


{{GenericsSTCTest.testSelfReferentialTypeParameter5}} uses 
{{@Grab('org.springframework.boot:spring-boot-starter-webflux:2.6.7')}}, and 
{{GenericsStaticCompileTest}} extends {{GenericsSTCTest}}, so the grab runs in 
two test classes. Each {{Test}} task gives its test JVMs one grape root, 
{{<temporaryDir>/.groovy}}, and deletes it in {{doFirst}} 
({{build-logic/src/main/groovy/org.apache.groovy-tested.gradle}}) unless 
{{groovy.grape.bridge-cache}} is set. With {{maxParallelForks}} above 1, both 
classes can resolve the same artifacts into the empty cache at the same time. 
In two local full runs of the core tests, one of the two failed with:

{noformat}
java.lang.ExceptionInInitializerError
...
Caused by: java.lang.RuntimeException: Error grabbing Grapes -- [unresolved 
dependency: io.netty#netty-resolver-dns-native-macos;4.1.75.Final: several 
problems occurred while resolving dependency: ...
  java.text.ParseException: [[Fatal Error] ivy-4.1.75.Final.xml.original:83:60: 
Element type "m:dependency.management__io.netty__netty-tcnative__jar__" must be 
followed by either attribute specifications, ">" or "/>". in 
file:.../build/tmp/test/.groovy/grapes/io.netty/netty-resolver-dns-native-macos/ivy-4.1.75.Final.xml.original
  java.text.ParseException: [[Fatal Error] ivy-4.1.75.Final.xml.original:79:60: 
Element type "m:dependency.management__io.netty__netty-tcnative__jar__" must be 
followed by either attribute specifications, ">" or "/>". in 
file:.../build/tmp/test/.groovy/grapes/io.netty/netty-parent/...
{noformat}

The test passes on its own, also starting from an empty cache. 
{{defaultGrapeConfig.xml}} sets {{lockStrategy="artifact-lock-nio"}}, so the 
failure suggests that one JVM read a descriptor the other was still writing.

Expected: the grab does not depend on which test classes run at the same time, 
for example by giving each test JVM its own grape root, or by keeping the two 
classes out of parallel forks.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to