Some testing improvements for Cassandra
* Remove the `cassandra.yaml` from test resources since it does not have any effect on the clients. Use `datastax-java-driver.basic.request.timeout` system property instead with `10 seconds` value to allow Cassandra client to wait for query results a little more than 2 seconds * Expose just an IP address for contact endpoint avoiding overhead with attempts to connect to all addresses returned by `localhost` resolution * Bring back `log4j-slf4j-impl` dependency since it is required for other libs
This commit is contained in:
@@ -284,6 +284,7 @@ configure(javaProjects) { subproject ->
|
||||
|
||||
testRuntimeOnly 'org.apache.logging.log4j:log4j-core'
|
||||
testRuntimeOnly 'org.apache.logging.log4j:log4j-jcl'
|
||||
testRuntimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl'
|
||||
testRuntimeOnly 'org.apache.logging.log4j:log4j-slf4j2-impl'
|
||||
}
|
||||
|
||||
|
||||
@@ -34,12 +34,11 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
@Testcontainers(disabledWithoutDocker = true)
|
||||
public interface CassandraContainerTest {
|
||||
|
||||
CassandraContainer<?> CASSANDRA_CONTAINER =
|
||||
new CassandraContainer<>("cassandra:4.1")
|
||||
.withConfigurationOverride("cassandra");
|
||||
CassandraContainer<?> CASSANDRA_CONTAINER = new CassandraContainer<>("cassandra:4.1");
|
||||
|
||||
@BeforeAll
|
||||
static void startContainer() {
|
||||
System.setProperty("datastax-java-driver.basic.request.timeout", "10 seconds");
|
||||
CASSANDRA_CONTAINER.start();
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class IntegrationTestConfig extends AbstractReactiveCassandraConfiguratio
|
||||
|
||||
@Override
|
||||
protected String getContactPoints() {
|
||||
return CassandraContainerTest.CASSANDRA_CONTAINER.getContactPoint().getHostName();
|
||||
return CassandraContainerTest.CASSANDRA_CONTAINER.getContactPoint().getAddress().getHostAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user