Skip to content

Cannot connect to Cassandra in test-containers with datastax-java-core-driver on Apple Macbook M1 #4934

@dgm90

Description

@dgm90

I am having an issue in my integration tests on Apple M1. The tests can not connect to Cassandra running in test-containers.

Query timed out after PT2S
com.datastax.oss.driver.api.core.DriverTimeoutException: Query timed out after PT2S
	at com.datastax.oss.driver.api.core.DriverTimeoutException.copy(DriverTimeoutException.java:34)
	at com.datastax.oss.driver.internal.core.util.concurrent.CompletableFutures.getUninterruptibly(CompletableFutures.java:149)
	at com.datastax.oss.driver.internal.core.cql.CqlRequestSyncProcessor.process(CqlRequestSyncProcessor.java:53)
	at com.datastax.oss.driver.internal.core.cql.CqlRequestSyncProcessor.process(CqlRequestSyncProcessor.java:30)
	at com.datastax.oss.driver.internal.core.session.DefaultSession.execute(DefaultSession.java:230)
	at com.datastax.oss.driver.api.core.cql.SyncCqlSession.execute(SyncCqlSession.java:54)
	at com.datastax.oss.driver.api.core.cql.SyncCqlSession.execute(SyncCqlSession.java:78)

The stack is:

  • Azul Java 11.0.13+8
  • kotlin("jvm") version "1.5.21"
  • Docker version 20.10.12, build e91ed57
  • implementation("com.datastax.oss:java-driver-core:4.13.0")
  • testImplementation("org.testcontainers:cassandra:1.16.2")

There are no errors in container, but the tests fail with timeout. Also, I am able to connect to cassandra via Intellij, when I pause the tests in debug session.

I see, that there was an issue with JNA not supporting the arm64 and this was fixed in 5.7.0 version.
If I check the cassandra container, ran by test containers, it uses the jna-5.6.0.jar. Could it possibly be the reason?

The same versions and code work well on Intel-based Macbook

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions