-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better error message for @ParameterizedTest failures in a @QuarkusTest #38991
Comments
@holly-cummins was looking into a holistic fix, but I am not sure where we are with that, or if it's even possible |
I know this error well (unfortunately). It's a side effect of trying to move objects from one classloader to another, with their state intact. User code doesn't do that, but the test code does do that, for reasons. The way the test framework does that cloning is to use XStream serialization. That was always a bit fragile, but recent versions of Java block the private field access that XStream needs. The reason we need to move objects from one classloader to another is that JUnit loads the classes with one classloader, but then the tests need to run in a different classloader to be in the proper Quarkus classloading environment. I've got a patch which just loads the class in the correct classloader in the first place, which saves a great deal of hassle. Sadly, there was one path where my nice clean logic didn't work, and in order to get that path working, I had to pull a big chunk of the JUnit codebase into our codebase, which seemed too icky. So I got distracted by other things, while I waited for inspiration to strike. I'll grab this defect and add it to my pile. In the interim, one workaround is to run on a pre-16 JVM, but on Quarkus 3.7+, that's not exactly going to be a viable workaround. (Doh!) |
This error definitely won't be the same after #40601 was merged |
Relates to quarkusio#40601, quarkusio#40749, quarkusio#38991. No use waiting for Dependabot. Fixes problem where an NPE can occur in some tests.
Let's close this as the error message is different |
Describe the bug
I am running a @ParameterizedTest with @QuarkusTest.
I am getting an error. The same code without @QuarkusTest runs successfully, in a normal @ParameterizedTest.
The error message talks about unrelated topics, such as XStream (which we don't use) and cloning.
Expected behavior
A clear, helpful error message with a line number for me to look at.
Actual behavior
A weird XStream cloning exception, with no clue which line is causing it.
We don't use XStream. We don't do cloning here.
How to Reproduce?
Here's the test that I ran on timefold-quickstarts:
Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: