JetBrains / lincheck

Framework for testing concurrent data structures
Mozilla Public License 2.0
564 stars 33 forks source link

Slf4j incompatibility #169

Closed CLOVIS-AI closed 3 months ago

CLOVIS-AI commented 1 year ago

When running a test which uses Slf4J's LoggerFactory.getLogger, the test fails (in both stress-testing and model-testing) with:

java.lang.reflect.InvocationTargetException
Caused by: javax.xml.parsers.FactoryConfigurationError: Provider com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl could not be instantiated: java.lang.ClassCastException: com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory
Caused by: java.lang.ClassCastException: com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory

Full stack trace | Source commit.

Full reproduction

Scripted as a Dockerfile for ease of use, but should do the same with any Java installation: ```dockerfile FROM archlinux:base # Requires a working JRE RUN pacman -Syuu --noconfirm git jre-openjdk ENV JAVA_HOME=/usr/lib/jvm/default-runtime # Checkout the project RUN mkdir -p /opt RUN git clone https://gitlab.com/opensavvy/pedestal.git /opt/pedestal WORKDIR /opt/pedestal RUN git switch --detach 1c5c820f # Run the JVM tests RUN ./gradlew cache:jvmTest ```

It seems a common pattern that Lincheck fails with logging libraries (#133, #116), but the error message is quite different, so I don't know if it's the same underlying problem or not.

ndkoval commented 7 months ago

The issue will likely be automatically resolved with #136

ndkoval commented 4 months ago

Hi, @CLOVIS-AI! It has taken a while to address the issue, but the recent 2.30 release should've fixed it. Could you please check?

CLOVIS-AI commented 3 months ago

Hi! Indeed, it seems to work, now.

Well, at least, it runs, takes some time, and then ends without printing any errors. Can you take a quick look at the test in case I wrote it incorrectly :pray:?

ndkoval commented 3 months ago

@CLOVIS-AI, the test looks good to me!

Since the issue has been fixed, I'm closing it now.