Hey Folks,
I’m upgrade a large, complex project from Gradle 6 to 8.6. The 7.0 and 7.6 ports went well. I’m now going from 7.6 to 8.6.
Many of my tests currently fail throwing an AbstractMethodError in TestResultProcessor.failure(). The stack trace implies it is from the AttachParentTestResultProcessor implementation of TestResultProcessor. This error indicates a missing implementation of an abstract method. That’s normally caught at compile time, so I’m guessing this is a problem with a wrong jar being loaded. But with --debug turned on, I only see Gradle 8.6 jars being loaded.
My next assumption is that, according to my decompiler, AttachparentTestResultProcessor indirects in its failure() method to the failure() method of another TestResultProcessor. So I’m guessing that it’s actually that implementation which is failing. Unfortunately when I put a break point there, the only time it triggers the contained object is a “CaptureTestOutputTestResultProcessor”, which comes from the same jar. It doesn’t trigger when the actual error occurs.
If it isn’t one of the TestResultProcessors included with Gradle, I’m thinking it might be from a plugin or something. I can’t seem to find any plugin that does that sort of thing. But it’s a large, complex code base, so it’s hard to tell. I’ve tried putting in breakpoints higher up the chain, but it complains saying that the (decompiled) source code does not match the bytecode. I tried downloading the sources for gradle-api, but they do not include the internal classes.
Does anyone have any suggestions for debugging this? Is there some instrumentation I can turn on? Is there a way to get the legit source code so I can mark break points?
Many thanks for any help,
Jo
I backed my build to Gradle 7.6, and I’m getting the same error. I didn’t before. What could be sticky in the environment?
It was my mistake. I didn’t get it in 7.0, but I did in 7.6. I’ve tried all intermediary versions and have narrowed it down to something changing between 7.5 and 7.6.
So what has changed is that org.gradle.api.internal.tasks.testing.TestResultProcessor.failure() has changed signature:
< public void failure(Object testId, Throwable result) {
---
> public void failure(Object testId, TestFailure result) {
So, somehow, I have a TestResultProcessor in my mix that is built against the old one. Any suggestions on how to find it?
Eventually worked it out. The version of the org.gradle.test-retry plugin we were using was not compatible with later versions of Gradle. No warnings. And the error was pretty opaque. I hope this thread helps someone in the future.