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

[Bug]: Cannot run build using Testcontainers on JDK 23+ #8986

Closed
marko-bekhta opened this issue Jul 24, 2024 · 0 comments · Fixed by #9041
Closed

[Bug]: Cannot run build using Testcontainers on JDK 23+ #8986

marko-bekhta opened this issue Jul 24, 2024 · 0 comments · Fixed by #9041
Labels

Comments

@marko-bekhta
Copy link

marko-bekhta commented Jul 24, 2024

Module

Core

Testcontainers version

1.20.0

Using the latest Testcontainers version?

Yes

Host OS

Linux

Host Arch

x86

Docker version

Client: Docker Engine - Community
 Version:           27.1.0
 API version:       1.46
 Go version:        go1.21.12
 Git commit:        6312585
 Built:             Fri Jul 19 17:45:03 2024
 OS/Arch:           linux/amd64
 Context:           default

What happened?

Attempting to use TestContainers and JDk 23+ results in:

09:56:16,255 (main) ERROR DockerClientProviderStrategy:269 - Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
	DockerDesktopClientProviderStrategy: failed with exception NullPointerException (Cannot invoke "java.nio.file.Path.toString()" because the return value of "org.testcontainers.dockerclient.DockerDesktopClientProviderStrategy.getSocketPath()" is null)As no valid configuration was found, execution cannot continue.
See https://java.testcontainers.org/on_failure.html for more details.

This is caused by the Awaitility upgrade in this commit c177fb2 which is causing

java.lang.NumberFormatException: For input string: "23-ea"

in this block of code checking the socket strategy:

try (Socket socket = socketProvider.call()) {
Duration timeout = Duration.ofMillis(200);
Awaitility
.await()
.atMost(TestcontainersConfiguration.getInstance().getClientPingTimeout(), TimeUnit.SECONDS)
.pollInterval(timeout)
.pollDelay(Duration.ofSeconds(0)) // start checking immediately
.ignoreExceptionsInstanceOf(SocketTimeoutException.class)
.untilAsserted(() -> socket.connect(socketAddress, (int) timeout.toMillis()));
return true;

on JDK 23+

See:
awaitility/awaitility#277
awaitility/awaitility#275

for the related issue on the Awaitility side.

Relevant log output

No response

Additional Information

Maybe it is worth downgrading to the 4.2.0 version for the time those issues are not addressed on the Awaitility side ?

@eddumelendez eddumelendez changed the title [Bug]: Cannot run build using Test Containers on JDK 23+ [Bug]: Cannot run build using Testcontainers on JDK 23+ Jul 24, 2024
eddumelendez added a commit that referenced this issue Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant