-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Load Testcontainers parent first and start the containers with the Platform CL as the TCCL #42560
base: main
Are you sure you want to change the base?
Conversation
@aloubyansky this is what I was talking about. |
|
To avoid long lived threads being attached to child class loaders. It was done at some point but was reverted because of the ducttape dependency not being parent first. I think it's worth another try by including this dependency.
While we probably want to be a lot more clever about it, it's the easiest way to have it in the test classpath and thus being allowed to load it parent first.
Testcontainers start several long lived threads (Ryuk reaper, ducttape), and if the TCCL is one of the QuarkusClassLoader, we end up leaking the class loaders. Using the Platform CL makes sure we don't leak any QuarkusClassLoader via these threads. The observability containers have not been adjusted as they are a bit of a weird beast and not worth having a look in the scope of this experiment.
29e5a81
to
c75ded8
Compare
FWIW, while it fixes the problem in the OP's case and somehow works in some cases (a PostgreSQL container works fine), this PR comes with all sorts of issues. It includes the following issues but there are others: MongoDB
IBM Db2
Microsoft SQL Server
|
I marked this PR ready for review to prepare for a talk (and get a CI report). DON'T MERGE IT. |
Status for workflow
|
Status | Name | Step | Failures | Logs | Raw logs | Build scan |
---|---|---|---|---|---|---|
✖ | JVM Tests - JDK 17 | Build |
Failures | Logs | Raw logs | 🔍 |
✖ | JVM Tests - JDK 21 | Build |
Failures | Logs | Raw logs | 🔍 |
✖ | Gradle Tests - JDK 17 | Build |
Failures | Logs | Raw logs | 🔍 |
✖ | Gradle Tests - JDK 17 Windows | Build |
Failures | Logs | Raw logs | 🚧 |
✖ | MicroProfile TCKs Tests | Verify |
Failures | Logs | Raw logs | 🔍 |
✖ | Native Tests - Data4 | Build |
Failures | Logs | Raw logs | 🔍 |
✖ | Native Tests - Security2 | Build |
Failures | Logs | Raw logs | 🚧 |
✖ | Native Tests - Security3 | Build |
Failures | Logs | Raw logs | 🚧 |
Full information is available in the Build summary check run.
You can consult the Develocity build scans.
Failures
⚙️ JVM Tests - JDK 17 #
- Failing: extensions/jdbc/jdbc-db2/deployment extensions/jdbc/jdbc-mssql/deployment extensions/keycloak-admin-rest-client/deployment and 8 more
! Skipped: extensions/keycloak-authorization/deployment extensions/oidc-client-filter/deployment extensions/oidc-client-graphql/deployment and 17 more
📦 extensions/jdbc/jdbc-db2/deployment
✖ io.quarkus.jdbc.db2.deployment.DevServicesDB2DatasourceTestCase.
- History - More details - Source on GitHub
📦 extensions/jdbc/jdbc-mssql/deployment
✖ io.quarkus.jdbc.mssql.deployment.DevServicesMsSQLDatasourceTestCase.
- History - More details - Source on GitHub
📦 extensions/keycloak-admin-rest-client/deployment
✖ io.quarkus.keycloak.admin.client.reactive.KeycloakAdminClientInjectionDevServicesTest.testGetRoles
- History - More details - Source on GitHub
📦 extensions/keycloak-admin-resteasy-client/deployment
✖ io.quarkus.keycloak.adminclient.deployment.KeycloakAdminClientInjectionDevServicesTest.testGetRoles
- History - More details - Source on GitHub
📦 extensions/oidc-client/deployment
✖ io.quarkus.oidc.client.OidcClientPasswordGrantSecretIsMissingTestCase.
line 36
- History - More details - Source on GitHub
✖ io.quarkus.oidc.client.OidcClientTooManyJwtCredentialKeyPropsTestCase.
line 36
- History - More details - Source on GitHub
📦 extensions/oidc-db-token-state-manager/deployment
✖ io.quarkus.oidc.db.token.state.manager.HibernateOrmPgDbTokenStateManagerTest.
- History - More details - Source on GitHub
✖ io.quarkus.oidc.db.token.state.manager.PostgresDbTokenStateManagerTest.
- History - More details - Source on GitHub
📦 extensions/reactive-mssql-client/deployment
✖ io.quarkus.reactive.mssql.client.DevServicesMsSQLDatasourceTestCase.
- History - More details - Source on GitHub
📦 integration-tests/mongodb-devservices
✖ io.quarkus.it.mongodb.BookResourceTest.
- History - More details - Source on GitHub
✖ io.quarkus.it.mongodb.BookResourceWithParameterInjectionTest.
- History - More details - Source on GitHub
✖ io.quarkus.it.mongodb.OtherProfileBookResourceTest.testBlockingClient
- History - More details - Source on GitHub
📦 integration-tests/oidc-client-registration
✖ io.quarkus.it.keycloak.OidcClientRegistrationTest.testRegisteredClientDynamicTenant
- History - More details - Source on GitHub
📦 integration-tests/oidc-mtls
✖ io.quarkus.it.oidc.OidcMtlsTest.testGetIdentityNames
- History - More details - Source on GitHub
📦 integration-tests/oidc-wiremock
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testClassLevelAnnotation
line 84
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testClassicHttpSecurityPolicyWithRbac
line 209
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testJaxRsAndClassicHttpSecurityPolicyNoRbac
line 236
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testJaxRsAndClassicHttpSecurityPolicyWithRbac
line 276
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testJaxRsHttpSecurityPolicyNoRbac
line 152
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testJaxRsHttpSecurityPolicyWithRbac
line 181
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testJaxRsIdentityAugmentation
line 308
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testMethodLevelAnnotation
line 113
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testPolicyAppliedBeforeTenantAnnotationMatched
line 356
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.BearerTokenOidcRecoveredTest.testOidcRecoveredWithDiscovery
line 36
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.BearerTokenOidcRecoveredTest.testOidcRecoveredWithNoDiscovery
line 61
- History - More details - Source on GitHub
⚙️ JVM Tests - JDK 21 #
- Failing: extensions/jdbc/jdbc-db2/deployment extensions/jdbc/jdbc-mssql/deployment extensions/keycloak-admin-rest-client/deployment and 8 more
! Skipped: extensions/keycloak-authorization/deployment extensions/oidc-client-filter/deployment extensions/oidc-client-graphql/deployment and 17 more
📦 extensions/jdbc/jdbc-db2/deployment
✖ io.quarkus.jdbc.db2.deployment.DevServicesDB2DatasourceTestCase.
- History - More details - Source on GitHub
📦 extensions/jdbc/jdbc-mssql/deployment
✖ io.quarkus.jdbc.mssql.deployment.DevServicesMsSQLDatasourceTestCase.
- History - More details - Source on GitHub
📦 extensions/keycloak-admin-rest-client/deployment
✖ io.quarkus.keycloak.admin.client.reactive.KeycloakAdminClientInjectionDevServicesTest.testGetRoles
- History - More details - Source on GitHub
📦 extensions/keycloak-admin-resteasy-client/deployment
✖ io.quarkus.keycloak.adminclient.deployment.KeycloakAdminClientInjectionDevServicesTest.testGetRoles
- History - More details - Source on GitHub
📦 extensions/oidc-client/deployment
✖ io.quarkus.oidc.client.OidcClientPasswordGrantSecretIsMissingTestCase.
line 36
- History - More details - Source on GitHub
✖ io.quarkus.oidc.client.OidcClientTooManyJwtCredentialKeyPropsTestCase.
line 36
- History - More details - Source on GitHub
📦 extensions/oidc-db-token-state-manager/deployment
✖ io.quarkus.oidc.db.token.state.manager.HibernateOrmPgDbTokenStateManagerTest.
- History - More details - Source on GitHub
✖ io.quarkus.oidc.db.token.state.manager.PostgresDbTokenStateManagerTest.
- History - More details - Source on GitHub
📦 extensions/reactive-mssql-client/deployment
✖ io.quarkus.reactive.mssql.client.DevServicesMsSQLDatasourceTestCase.
- History - More details - Source on GitHub
📦 integration-tests/mongodb-devservices
✖ io.quarkus.it.mongodb.BookResourceTest.
- History - More details - Source on GitHub
✖ io.quarkus.it.mongodb.BookResourceWithParameterInjectionTest.
- History - More details - Source on GitHub
✖ io.quarkus.it.mongodb.OtherProfileBookResourceTest.testBlockingClient
- History - More details - Source on GitHub
📦 integration-tests/oidc-client-registration
✖ io.quarkus.it.keycloak.OidcClientRegistrationTest.testRegisteredClientDynamicTenant
- History - More details - Source on GitHub
📦 integration-tests/oidc-mtls
✖ io.quarkus.it.oidc.OidcMtlsTest.testGetIdentityNames
- History - More details - Source on GitHub
📦 integration-tests/oidc-wiremock
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testClassLevelAnnotation
line 84
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testClassicHttpSecurityPolicyWithRbac
line 209
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testJaxRsAndClassicHttpSecurityPolicyNoRbac
line 236
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testJaxRsAndClassicHttpSecurityPolicyWithRbac
line 276
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testJaxRsHttpSecurityPolicyNoRbac
line 152
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testJaxRsHttpSecurityPolicyWithRbac
line 181
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testJaxRsIdentityAugmentation
line 308
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testMethodLevelAnnotation
line 113
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.AnnotationBasedTenantTest.testPolicyAppliedBeforeTenantAnnotationMatched
line 356
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.BearerTokenOidcRecoveredTest.testOidcRecoveredWithDiscovery
line 36
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.BearerTokenOidcRecoveredTest.testOidcRecoveredWithNoDiscovery
line 61
- History - More details - Source on GitHub
⚙️ Gradle Tests - JDK 17 #
- Failing: integration-tests/gradle
📦 integration-tests/gradle
✖ io.quarkus.gradle.devmode.BasicJavaLibraryModuleDevModeTest.main
- History - More details - Source on GitHub
✖ io.quarkus.gradle.devmode.MavenExclusionInExtensionDependencyDevModeTest.main
- History - More details - Source on GitHub
⚙️ Gradle Tests - JDK 17 Windows #
📦 integration-tests/gradle
✖ io.quarkus.gradle.devmode.MavenExclusionInExtensionDependencyDevModeTest.main
- History - More details - Source on GitHub
⚙️ MicroProfile TCKs Tests #
- Failing: tcks/jakarta-atinject tcks/jakarta-cdi-lang-model tcks/microprofile-lra and 4 more
📦 tcks/jakarta-atinject
✖ Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.0:test (default-test) on project quarkus-tck-jakarta-atinjecft:
Please refer to /home/runner/work/quarkus/quarkus/tcks/jakarta-atinject/target/surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
ExecutionException There was an error in the forked process
📦 tcks/jakarta-cdi-lang-model
✖ Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.0:test (default-test) on project quarkus-tck-jakarta-cdi-lang-model:
Please refer to /home/runner/work/quarkus/quarkus/tcks/jakarta-cdi-lang-model/target/surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
ExecutionException There was an error in the forked process
📦 tcks/microprofile-lra
✖ Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.0:test (default-test) on project quarkus-tck-microprofile-lra:
Please refer to /home/runner/work/quarkus/quarkus/tcks/microprofile-lra/target/surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
ExecutionException There was an error in the forked process
📦 tcks/microprofile-metrics/api
✖ Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.0:test (default-test) on project quarkus-tck-microprofile-metrics-api:
Please refer to /home/runner/work/quarkus/quarkus/tcks/microprofile-metrics/api/target/surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
There was an error in the forked process
📦 tcks/microprofile-metrics/optional
✖ Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.0:test (default-test) on project quarkus-tck-microprofile-metrics-optional:
Please refer to /home/runner/work/quarkus/quarkus/tcks/microprofile-metrics/optional/target/surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
There was an error in the forked process
📦 tcks/microprofile-metrics/rest
✖ Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.0:test (default-test) on project quarkus-tck-microprofile-metrics-rest:
Please refer to /home/runner/work/quarkus/quarkus/tcks/microprofile-metrics/rest/target/surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
There was an error in the forked process
📦 tcks/microprofile-reactive-messaging
✖ Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.0:test (default-test) on project quarkus-tck-microprofile-reactive-messaging:
Please refer to /home/runner/work/quarkus/quarkus/tcks/microprofile-reactive-messaging/target/surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
There was an error in the forked process
⚙️ Native Tests - Data4 #
- Failing: integration-tests/mongodb-devservices
📦 integration-tests/mongodb-devservices
✖ io.quarkus.it.mongodb.NativeBookResourceIT.health
- History - More details - Source on GitHub
✖ io.quarkus.it.mongodb.OtherProfileBookResourceIT.testBlockingClient
- History - More details - Source on GitHub
⚙️ Native Tests - Security2 #
📦 integration-tests/oidc-client-reactive
✖ io.quarkus.it.keycloak.OidcClientInGraalITCase.testGetUserNameNamedFilter
- History - More details - Source on GitHub
📦 integration-tests/oidc-token-propagation
✖ io.quarkus.it.keycloak.OidcTokenPropagationITCase.testGetClientNameWithJwtTokenPropagation
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.OidcTokenPropagationITCase.testGetUserNameFromServiceAccount
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.OidcTokenPropagationITCase.testGetUserNameWithAccessTokenPropagation
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.OidcTokenPropagationITCase.testGetUserNameWithJwtTokenPropagation
- History - More details - Source on GitHub
⚙️ Native Tests - Security3 #
📦 integration-tests/keycloak-authorization
✖ io.quarkus.it.keycloak.NativeAdminClientITCase.testGetExistingRealm
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.NativeAdminClientITCase.testGetNewRealm
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.PolicyEnforcerInGraalITCase.testBodyClaim
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.PolicyEnforcerInGraalITCase.testDynamicConfigNotApplied
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.PolicyEnforcerInGraalITCase.testHttpResponseFromExternalServiceAsClaim
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.PolicyEnforcerInGraalITCase.testPartyTokenRequest
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.PolicyEnforcerInGraalITCase.testPathConfigurationPrecedenceWhenPathCacheNotDefined
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.PolicyEnforcerInGraalITCase.testPermissionScopes
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.PolicyEnforcerInGraalITCase.testPublicResource
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.PolicyEnforcerInGraalITCase.testPublicResourceWithDisabledPolicyAndToken
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.PolicyEnforcerInGraalITCase.testPublicResourceWithEnforcingPolicy
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.PolicyEnforcerInGraalITCase.testPublicResourceWithEnforcingPolicyAndToken
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.PolicyEnforcerInGraalITCase.testRequestParameterAsClaim
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.PolicyEnforcerInGraalITCase.testUserHasAdminRoleServiceTenant
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.PolicyEnforcerInGraalITCase.testUserHasRoleConfidential
- History - More details - Source on GitHub
✖ io.quarkus.it.keycloak.PolicyEnforcerInGraalITCase.testUserHasSuperUserRoleWebTenant
- History - More details - Source on GitHub
Note
This PR is part of a coordinated effort to address the OOM reported in #42471:
This is the last piece of the puzzle to make #42471 actually pass.
TBH, I'm not exactly excited about adding testcontainers always but for now that's the only solution I could find.
There are two aspects to it:
QuarkusClassLoader
QuarkusClassLoader
The problem with the latter is that we then need to make testcontainers a dependency of
quarkus-test-common
so that it appears in the test classpath.There might be a better way to do it in the future with the work @holly-cummins has started but that's how it is for now (and I'm not entirely sure Holly's work would be enough to solve this as we would basically need to figure out that testcontainers is around and add it to a base class loader that would be shared across all the tests - it might be possible but I haven't looked at Holly's work yet).
The problem with Testcontainers is that there are some long lived threads that are kept around and our class loaders leak in two ways:
Thus why this work is in two parts.
Class loader of a long lived class:
TCCL of thread: