Cannot run tests with gradle #11630
Replies: 3 comments 4 replies
-
Inside IntelliJ the Anyway, I think the root problem is possibly something different, some livelock issue with Gradle or the JVM it is running with. Oddly, I seem to be getting it myself now too (same OS, Apple Silicon). I am guessing something is triggering a Gradle bug which isn't an issue with the CI builds. Can you try locally downgrading Gradle with FWIW, I have not had issues with running tests with Gradle from inside IntelliJ recently, but only did the Gradle 8 upgrade recently so probably hadn't run the full unit tests locally. |
Beta Was this translation helpful? Give feedback.
-
Thanks Chad, that has 'solved' it! I did actually try downgrading gradle to see if that fixed it, but went to The tests are now running, although not all pass, but I think this is an issue locally as it's the NB. I now appreciate why you tend not to run the 'quick' tests ⏲️😂 In terms of the issue with the |
Beta Was this translation helpful? Give feedback.
-
So I actually did do a little digging into why IntelliJ cannot resolve the classes in the sharedTest source set. I believe it's in some way related to this issue, but can't entirely pin it down. I did find though that removing this line: Line 331 in cbeed3f IntelliJ no longer thinks it's a test source set (highlights it in green), but the module is now correctly resolvable (by IntelliJ) in the tests that are using it. It's also, more importantly, not resolvable in production code due to the actual gradle source set config here: Lines 45 to 81 in cbeed3f I don't see any reason not to remove this line (and maybe the entire block, IntelliJ is much smarter these days out of the box), but have never actually had to play with the IntelliJ gradle plugin myself much, so I am unaware of any lurking dragons! |
Beta Was this translation helpful? Give feedback.
-
Hi! I am unfortunately having issues with running tests for the gocd codebase.
I have followed the instructions for 'Manual Setup' on https://developer.gocd.org/current/ on both an Intel-based and M1-based Macbook, unfortunately, both hit the same snag.
Whenever I run
./gradlew server:fastUnitTest
it runs for a couple of seconds and then hangs, digging into this further using./gradlew server:fastUnitTest --debug
I can see the following:I am not sure if related, but when browsing the code in intelliJ, classes from the
test-shared
module do not seem to be resolvable withintest-fast
one, I can see the gradle configuration that is supposed to make this happen though. Presumably, it's just not getting ran properly due to the gradle issue I am seeing.Any help would be appreciated in getting this working; I can somewhat work around it with the changes that I am making by selectively running tests, but I would like to sanity check before creating any kind of PR if at all possible!
Other potentially useful information:
java 17.0.2 2022-01-18 LTS
Ventura 13.1 (22C65)
Beta Was this translation helpful? Give feedback.
All reactions