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

Workaround classloading issue in Quarkus internal tests by making io.quarkus.security.test.utils.AuthData#applyAugmentors public #46584

Conversation

michalvavrik
Copy link
Member

@michalvavrik michalvavrik commented Mar 2, 2025

I wrote plugin that allows me to run all the tests in this project (both in extension deployment modules and IT modules) against delivered Quarkus artifacts placed in local Maven repository (like if I download RHBQ Maven repo zip and unwrap it) and tests that use quarkus-security-test-utils fails over some classloader issue even though Quarkus artifact versions seem to match, for example:

[ERROR]   CDIAccessDenyUnannotatedTest.shouldAllowClassLevelPermitAll:97 » IllegalAccess class io.quarkus.security.test.utils.IdentityMock tried to access field io.quarkus.security.test.utils.AuthData.applyAugmentors (io.quarkus.security.test.utils.IdentityMock is in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @25291901; io.quarkus.security.test.utils.AuthData is in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @7aa5292d)

No idea why, the only difference is that sources are not built locally, but instead artifacts are used from local repository. And also I made all dependencies a test scope ones (in extension modules). Now, io.quarkus.security.test.utils.AuthData#applyAugmentors field is only non-public field in the class and it was me who added it (and made it package-private), so maybe it would be acceptable to make it public?

It works around my issues, thanks. (P.S. I need this fix for 3.20, so adding a backport label)

Copy link
Member

@sberyozkin sberyozkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, should be safe to merge, I'll just CC @geoand for his attention

Copy link

quarkus-bot bot commented Mar 2, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 4f71248.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@geoand geoand merged commit f875e4b into quarkusio:main Mar 3, 2025
23 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.21 - main milestone Mar 3, 2025
@michalvavrik michalvavrik deleted the feature/workaroudn-class-loading-issue-in-auth-data branch March 3, 2025 08:12
@gsmet gsmet modified the milestones: 3.21 - main, 3.19.2 Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants