Skip to content
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

TCK SPI servlet tests fail when run after the Servlet unit tests #232

Open
simonladen opened this issue Jan 14, 2025 · 0 comments
Open

TCK SPI servlet tests fail when run after the Servlet unit tests #232

simonladen opened this issue Jan 14, 2025 · 0 comments

Comments

@simonladen
Copy link

Steps to reproduce locally:
(steps taken from Glassfish jenkins job running these TCKs)
wget -q 'https://download.eclipse.org/security/jakartaee11/staged/eftl/jakarta-authentication-tck-3.1.1.zip?c=d' -O jakarta-authentication-tck.zip
unzip -q jakarta-authentication-tck.zip
wget -q https://jakarta.oss.sonatype.org/content/repositories/staging/org/glassfish/main/distributions/glassfish/8.0.0-JDK17-M9/glassfish-8.0.0-JDK17-M9.zip -O glassfish.zip
mvn install:install-file -Dfile=./glassfish.zip -DgroupId=org.glassfish.main.distributions -DartifactId=glassfish -Dversion=8.0.0-X -Dpackaging=zip
cd authentication-tck-3.1.1/tck/
sed -i s/3.12.0/3.21.0/g pom.xml
mvn clean install -Pstaging,glassfish-ci-managed -Dglassfish.version=8.0.0-X -Dauthentication-api.update=false -Djakarta.authentication.version=3.1.0 surefire-report:failsafe-report-only -Daggregate=true

This downloads Glassfish 8.0.0-JDK17-M9, and authentication tck 3.1.1, and run them.
It fails on Jakarta Authentication TCK - Profile SPI Servlet 3.1.1
The error is: [Fatal Error] :1:2: The markup in the document preceding the root element must be well-formed. org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 2; The markup in the document preceding the root element must be well-formed.

It is caused by ServletUnitTest.java. These tests create the empty file authentication-trace-log.xml, and because it is empty, when ServletProfileSPITest fetches the logs and attempts to parse it, it fails because it only finds "" to parse as an xml.

Adding a step @afterclass in ServletUnitTest.java to delete authentication-trace-log.xml appears to solve the issue, ServletProfileSPITest creates the file again and fills it properly.

Alternatively, these tests work in Jenkins because the order of the tests is different there. If you run ServletProfileSPITest.java before ServletUnitTest.java, then the tests run properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant