-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Add JNA dep to testcontainers #131747
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
Open
DaveCTurner
wants to merge
1
commit into
elastic:main
Choose a base branch
from
DaveCTurner:2025/07/23/testcontainers-jna
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add JNA dep to testcontainers #131747
DaveCTurner
wants to merge
1
commit into
elastic:main
from
DaveCTurner:2025/07/23/testcontainers-jna
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Running Docker-testcontainer-related tests on a completely freshly rebuilt Ubuntu machine fail for me with the following exception: ``` [SUITE-S3RepositoryThirdPartyTests-seed#[F84B73F349864988]] INFO org.elasticsearch.test.fixtures.testcontainers.DockerEnvironmentAwareTestContainer - Probing docker environment... [SUITE-S3RepositoryThirdPartyTests-seed#[F84B73F349864988]] WARN org.elasticsearch.test.fixtures.testcontainers.DockerEnvironmentAwareTestContainer - Probing docker has failed; disabling test java.lang.NoClassDefFoundError: com/sun/jna/Library at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) at org.testcontainers.dockerclient.RootlessDockerClientProviderStrategy.lambda$null$0(RootlessDockerClientProviderStrategy.java:37) at java.base/java.util.Optional.orElseGet(Optional.java:364) at org.testcontainers.dockerclient.RootlessDockerClientProviderStrategy.lambda$resolveSocketPath$1(RootlessDockerClientProviderStrategy.java:36) at java.base/java.util.Optional.orElseGet(Optional.java:364) at org.testcontainers.dockerclient.RootlessDockerClientProviderStrategy.resolveSocketPath(RootlessDockerClientProviderStrategy.java:33) at org.testcontainers.dockerclient.RootlessDockerClientProviderStrategy.getSocketPath(RootlessDockerClientProviderStrategy.java:29) at org.testcontainers.dockerclient.RootlessDockerClientProviderStrategy.isApplicable(RootlessDockerClientProviderStrategy.java:82) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1685) at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129) at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647) at org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrategy.java:267) at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:152) at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:194) at org.elasticsearch.test.fixtures.testcontainers.DockerEnvironmentAwareTestContainer.isDockerAvailable(DockerEnvironmentAwareTestContainer.java:51) at org.elasticsearch.test.fixtures.testcontainers.DockerEnvironmentAwareTestContainer.<clinit>(DockerEnvironmentAwareTestContainer.java:43) at org.elasticsearch.repositories.s3.S3RepositoryThirdPartyTests.<clinit>(S3RepositoryThirdPartyTests.java:64) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:534) at java.base/java.lang.Class.forName(Class.java:513) at com.carrotsearch.randomizedtesting.RandomizedRunner$2.run(RandomizedRunner.java:631) Caused by: java.lang.ClassNotFoundException: com.sun.jna.Library at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ... 36 more ``` This change fixes it for me. Oddly enough this line doesn't seem necessary after the first time I run such a test.
Pinging @elastic/es-delivery (Team:Delivery) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
auto-backport
Automatically create backport pull requests when merged
:Delivery/Build
Build or test infrastructure
Team:Delivery
Meta label for Delivery team
>test
Issues or PRs that are addressing/adding tests
v8.18.5
v8.19.1
v9.0.5
v9.1.1
v9.2.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Running Docker-testcontainer-related tests on a completely freshly
rebuilt Ubuntu machine fail for me with the following exception:
This change fixes it for me. Oddly enough this line doesn't seem
necessary after the first time I run such a test.