Git Product home page Git Product logo

testcontainers-redis's Introduction

Testcontainers Redis

Build Status Download License

Testcontainers Redis is an extension of Testcontainers that supports Redis (Standalone and Cluster), Redis Modules, and Redis Enterprise containers.

Getting Started

Gradle

dependencies {
    testImplementation "com.redis:testcontainers-redis:2.2.2"
}

Maven

<dependency>
    <groupId>com.redis</groupId>
    <artifactId>testcontainers-redis</artifactId>
    <version>2.2.2</version>
    <scope>test</scope>
</dependency>

Usage

Redis Example

@Testcontainers
class RedisExampleTest {

    @Container
    private static RedisContainer container = new RedisContainer(
            RedisContainer.DEFAULT_IMAGE_NAME.withTag(RedisContainer.DEFAULT_TAG));

    @Test
    void testSomethingUsingLettuce() {
        // Retrieve the Redis URI from the container
        String redisURI = container.getRedisURI();
        RedisClient client = RedisClient.create(redisURI);
        try (StatefulRedisConnection<String, String> connection = client.connect()) {
            RedisCommands<String, String> commands = connection.sync();
            Assertions.assertEquals("PONG", commands.ping());
        }
    }
}

Redis Stack Example

@Testcontainers
class RedisStackExampleTest {

    @Container
    private static RedisStackContainer container = new RedisStackContainer(
            RedisStackContainer.DEFAULT_IMAGE_NAME.withTag(RedisStackContainer.DEFAULT_TAG));

    @Test
    void testSomethingUsingLettuceMod() {
        // Retrieve the Redis URI from the container
        String redisURI = container.getRedisURI();
        RedisModulesClient client = RedisModulesClient.create(redisURI);
        try (StatefulRedisModulesConnection<String, String> connection = client.connect()) {
            RedisModulesCommands<String, String> commands = connection.sync();
            commands.ftCreate("myIndex", Field.tag("myField").build());
            IndexInfo indexInfo = RedisModulesUtils.indexInfo(commands.ftInfo("myIndex"));
            Assertions.assertEquals(1, indexInfo.getFields().size());
            Assertions.assertEquals("myField", indexInfo.getFields().get(0).getName());
        }
    }
}

testcontainers-redis's People

Contributors

github-actions[bot] avatar jruaux avatar rollczi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

testcontainers-redis's Issues

AbstractRedisContainer `.*Ready to accept connections.*\\n` Doesn't match custom installation images

To resolve the redis:7.2-alpine vulnerabilities I've build my own docker image for redis based on ubuntu:noble.
image

FROM ubuntu:noble

# List linux version
RUN cat /etc/issue

USER root

RUN echo "Installing Debian dependencies..." \
  # `apt-get update` caused error `W: GPG error: http://security.debian.org/debian-security stretch/updates InRelease: At least one invalid signature was encountered.` fix: https://github.com/debuerreotype/docker-debian-artifacts/issues/69#issuecomment-603864015
  export DEBIAN_FRONTEND="noninteractive" && \
    # `Error debconf: unable to initialize frontend: Redline` error. Fix: https://github.com/moby/moby/issues/27988#issuecomment-462809153
  echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
  apt-get update && apt-get upgrade -y && \
  apt-get install --no-install-recommends --no-install-suggests -y \
    redis-server

# Create K8s run groups
ARG USER=default-docker
RUN groupadd --gid 2000 runAsGroup \
  && groupadd --gid 3000 fsGroup \
  && useradd --uid 1001 --gid 3000 --system --home /home --shell /bin/bash  -c "Default Dockerfile User" $USER \
  && usermod -a -G runAsGroup $USER

# Add 1001 to the 'redis' group.
RUN usermod -a -G redis $USER

The issue is the startup logs. On the redis:7.2-alpine image the startup logs are:

redis-1  | 1:M 18 Apr 2024 15:32:17.010 * Ready to accept connections tcp

On my custom ubuntu:noble image the startup logs are:

redis-1  | 7:M 18 Apr 2024 15:29:58.187 * Ready to accept connections

You can see the problem in the regex here: AbstractRedisContainer.java#L21 .*Ready to accept connections.*\\n requires 1 or more characters between the work connections and the \n character.

Suggested Solution:

  1. Allow users to configure the readiness check
  2. Change the regex to .*Ready to accept connections(.*)?\\n
  3. Combination of both?

Let me know what you prefer and I can contribute a fix.

using testcontainers-redis-junit-jupiter depends on org.junit.rules.TestRule

running pure jupiter application (excluding junit) generates this error:
java: cannot access org.junit.rules.TestRule class file for org.junit.rules.TestRule not found

when having this code

@Container private static final RedisContainer REDIS_CONTAINER = new RedisContainer(DockerImageName.parse("redis:5.0.3-alpine")).withExposedPorts(6379);

Unable to create cluster on ARM Mac

The image starts okay, but then creating the cluster fails. Here are the JUnit logs:

org.testcontainers.containers.ContainerLaunchException: Container startup failed for image redislabs/redis:7.4.2-129
	at app//org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:359)
	at app//com.redis.enterprise.testcontainers.RedisEnterpriseContainer.doStart(RedisEnterpriseContainer.java:67)
	at app//org.testcontainers.containers.GenericContainer.start(GenericContainer.java:330)
	at app//org.testcontainers.junit.jupiter.TestcontainersExtension$StoreAdapter.start(TestcontainersExtension.java:280)
	at app//org.testcontainers.junit.jupiter.TestcontainersExtension$StoreAdapter.access$200(TestcontainersExtension.java:267)
	at app//org.testcontainers.junit.jupiter.TestcontainersExtension.lambda$null$4(TestcontainersExtension.java:82)
	at app//org.junit.platform.engine.support.store.NamespacedHierarchicalStore.lambda$getOrComputeIfAbsent$5(NamespacedHierarchicalStore.java:147)
	at app//org.junit.platform.engine.support.store.NamespacedHierarchicalStore$MemoizingSupplier.computeValue(NamespacedHierarchicalStore.java:372)
	at app//org.junit.platform.engine.support.store.NamespacedHierarchicalStore$MemoizingSupplier.get(NamespacedHierarchicalStore.java:361)
	at app//org.junit.platform.engine.support.store.NamespacedHierarchicalStore$StoredValue.evaluate(NamespacedHierarchicalStore.java:308)
	at app//org.junit.platform.engine.support.store.NamespacedHierarchicalStore$StoredValue.access$200(NamespacedHierarchicalStore.java:287)
	at app//org.junit.platform.engine.support.store.NamespacedHierarchicalStore.getOrComputeIfAbsent(NamespacedHierarchicalStore.java:149)
	at app//org.junit.jupiter.engine.execution.NamespaceAwareStore.lambda$getOrComputeIfAbsent$2(NamespaceAwareStore.java:57)
	at app//org.junit.jupiter.engine.execution.NamespaceAwareStore.accessStore(NamespaceAwareStore.java:90)
	at app//org.junit.jupiter.engine.execution.NamespaceAwareStore.getOrComputeIfAbsent(NamespaceAwareStore.java:57)
	at app//org.testcontainers.junit.jupiter.TestcontainersExtension.lambda$startContainers$5(TestcontainersExtension.java:82)
	at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1596)
	at app//org.testcontainers.junit.jupiter.TestcontainersExtension.startContainers(TestcontainersExtension.java:82)
	at app//org.testcontainers.junit.jupiter.TestcontainersExtension.beforeAll(TestcontainersExtension.java:56)
	at app//org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$12(ClassBasedTestDescriptor.java:396)
	at app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at app//org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:396)
	at app//org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:212)
	at app//org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:85)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:148)
	at app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at app//org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1596)
	at app//org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at app//org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at app//org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
	at app//org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at app//org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
	at app//org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
	at app//org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
	at app//org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
	at app//org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
	at app//org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
	at app//org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
	at app//org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
	at app//org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:119)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:94)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:89)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:62)
	at [email protected]/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:580)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at jdk.proxy2/jdk.proxy2.$Proxy5.stop(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker$3.run(TestWorker.java:193)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
	at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:113)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:65)
	at app//worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
	at app//worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at app//org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at app//org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:344)
	... 72 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at app//org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:563)
	at app//org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:354)
	at app//org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 73 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not initialize Redis Enterprise
	at app//com.redis.enterprise.testcontainers.AbstractRedisEnterpriseContainer.containerIsStarted(AbstractRedisEnterpriseContainer.java:57)
	at app//org.testcontainers.containers.GenericContainer.containerIsStarted(GenericContainer.java:721)
	at app//org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:542)
	... 75 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create cluster
	at app//com.redis.enterprise.testcontainers.AbstractRedisEnterpriseContainer.createCluster(AbstractRedisEnterpriseContainer.java:99)
	at app//com.redis.enterprise.testcontainers.RedisEnterpriseContainer.createCluster(RedisEnterpriseContainer.java:74)
	at app//com.redis.enterprise.testcontainers.AbstractRedisEnterpriseContainer.containerIsStarted(AbstractRedisEnterpriseContainer.java:55)
	... 77 more

and here are the logs from test container startup including the error from rladmin

11:56:39.161 [Test worker] INFO org.testcontainers.images.PullPolicy -- Image pull policy will be performed by: DefaultPullPolicy()
11:56:39.167 [Test worker] INFO org.testcontainers.utility.ImageNameSubstitutor -- Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
11:56:39.516 [Test worker] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy -- Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
11:56:39.684 [Test worker] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy -- Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
11:56:39.685 [Test worker] INFO org.testcontainers.DockerClientFactory -- Docker host IP address is localhost
11:56:39.700 [Test worker] INFO org.testcontainers.DockerClientFactory -- Connected to docker: 
  Server Version: 26.0.0
  API Version: 1.45
  Operating System: Docker Desktop
  Total Memory: 7840 MB
11:56:39.767 [Test worker] INFO tc.testcontainers/ryuk:0.6.0 -- Creating container for image: testcontainers/ryuk:0.6.0
11:56:39.811 [Test worker] INFO org.testcontainers.utility.RegistryAuthLocator -- Credential helper/store (docker-credential-desktop) does not have credentials for https://index.docker.io/v1/
11:56:39.876 [Test worker] INFO tc.testcontainers/ryuk:0.6.0 -- Container testcontainers/ryuk:0.6.0 is starting: a21667056e7c430d9ae75ffd662c553507b2a62bfc23f72b760e9c9981d5f34a
11:56:40.022 [Test worker] INFO tc.testcontainers/ryuk:0.6.0 -- Container testcontainers/ryuk:0.6.0 started in PT0.254542S
11:56:40.025 [Test worker] INFO org.testcontainers.utility.RyukResourceReaper -- Ryuk started - will monitor and terminate Testcontainers containers on JVM exit
11:56:40.025 [Test worker] INFO org.testcontainers.DockerClientFactory -- Checking the system...
11:56:40.025 [Test worker] INFO org.testcontainers.DockerClientFactory -- โœ”๏ธŽ Docker server version should be at least 1.6.0
11:56:40.025 [Test worker] INFO tc.redislabs/redis:7.4.2-129 -- Creating container for image: redislabs/redis:7.4.2-129
11:56:40.063 [Test worker] INFO tc.redislabs/redis:7.4.2-129 -- Container redislabs/redis:7.4.2-129 is starting: 6d57d24db11b43c3c12a89e0a3b35c6fb51ac1d06e9769a3a84859835a50a483
11:56:40.372 [Test worker] WARN tc.redislabs/redis:7.4.2-129 -- The architecture 'amd64' for image 'redislabs/redis:7.4.2-129' (ID sha256:3fe0bdc3e05a6696cab692fdc903a31896b2618a3667945f854e19079d864d5f) does not match the Docker server architecture 'arm64'. This will cause the container to execute much more slowly due to emulation and may lead to timeout failures.
11:56:51.974 [Test worker] INFO tc.redislabs/redis:7.4.2-129 -- Container redislabs/redis:7.4.2-129 started in PT11.948862S
11:56:51.975 [Test worker] INFO com.redis.enterprise.testcontainers.RedisEnterpriseContainer -- Waiting for cluster bootstrap
11:56:55.926 [Test worker] INFO com.redis.enterprise.testcontainers.AbstractRedisEnterpriseContainer -- Creating cluster
11:56:57.817 [Test worker] ERROR com.redis.enterprise.testcontainers.AbstractRedisEnterpriseContainer -- Could not create cluster: Traceback (most recent call last):
  File "/opt/redislabs/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "/opt/redislabs/lib/python3.9/site-packages/urllib3/util/connection.py", line 95, in create_connection
    raise err
  File "/opt/redislabs/lib/python3.9/site-packages/urllib3/util/connection.py", line 85, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/redislabs/lib/python3.9/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/opt/redislabs/lib/python3.9/site-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "/opt/redislabs/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
    conn.connect()
  File "/opt/redislabs/lib/python3.9/site-packages/urllib3/connection.py", line 358, in connect
    self.sock = conn = self._new_conn()
  File "/opt/redislabs/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7ffff2729220>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/redislabs/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/opt/redislabs/lib/python3.9/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(
  File "/opt/redislabs/lib/python3.9/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='localhost', port=9443): Max retries exceeded with url: /v1/bootstrap/create_cluster (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ffff2729220>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/redislabs/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/redislabs/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "cnm/cli/rladmin/__main__.py", line 24, in <module>
  File "cnm/cli/rladmin/admin_shell.py", line 2775, in run
  File "/opt/redislabs/lib/python3.9/site-packages/cly/parser.py", line 148, in execute
    return node.terminal(self)
  File "/opt/redislabs/lib/python3.9/site-packages/cly/builder.py", line 562, in terminal
    return self.callback(**context.vars)
  File "cnm/cli/rladmin/admin_commands.py", line 2809, in create_cluster
  File "cnm/restclient.py", line 315, in post
  File "/opt/redislabs/lib/python3.9/site-packages/requests/sessions.py", line 590, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/opt/redislabs/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/redislabs/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/opt/redislabs/lib/python3.9/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='localhost', port=9443): Max retries exceeded with url: /v1/bootstrap/create_cluster (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ffff2729220>: Failed to establish a new connection: [Errno 111] Connection refused'))

11:56:57.819 [Test worker] ERROR tc.redislabs/redis:7.4.2-129 -- Could not start container
org.testcontainers.containers.ContainerLaunchException: Could not initialize Redis Enterprise
	at com.redis.enterprise.testcontainers.AbstractRedisEnterpriseContainer.containerIsStarted(AbstractRedisEnterpriseContainer.java:57)
	at org.testcontainers.containers.GenericContainer.containerIsStarted(GenericContainer.java:721)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:542)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:354)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:344)
	at com.redis.enterprise.testcontainers.RedisEnterpriseContainer.doStart(RedisEnterpriseContainer.java:67)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:330)
	at org.testcontainers.junit.jupiter.TestcontainersExtension$StoreAdapter.start(TestcontainersExtension.java:280)
	at org.testcontainers.junit.jupiter.TestcontainersExtension$StoreAdapter.access$200(TestcontainersExtension.java:267)
	at org.testcontainers.junit.jupiter.TestcontainersExtension.lambda$null$4(TestcontainersExtension.java:82)
	at org.junit.platform.engine.support.store.NamespacedHierarchicalStore.lambda$getOrComputeIfAbsent$5(NamespacedHierarchicalStore.java:147)
	at org.junit.platform.engine.support.store.NamespacedHierarchicalStore$MemoizingSupplier.computeValue(NamespacedHierarchicalStore.java:372)
	at org.junit.platform.engine.support.store.NamespacedHierarchicalStore$MemoizingSupplier.get(NamespacedHierarchicalStore.java:361)
	at org.junit.platform.engine.support.store.NamespacedHierarchicalStore$StoredValue.evaluate(NamespacedHierarchicalStore.java:308)
	at org.junit.platform.engine.support.store.NamespacedHierarchicalStore$StoredValue.access$200(NamespacedHierarchicalStore.java:287)
	at org.junit.platform.engine.support.store.NamespacedHierarchicalStore.getOrComputeIfAbsent(NamespacedHierarchicalStore.java:149)
	at org.junit.jupiter.engine.execution.NamespaceAwareStore.lambda$getOrComputeIfAbsent$2(NamespaceAwareStore.java:57)
	at org.junit.jupiter.engine.execution.NamespaceAwareStore.accessStore(NamespaceAwareStore.java:90)
	at org.junit.jupiter.engine.execution.NamespaceAwareStore.getOrComputeIfAbsent(NamespaceAwareStore.java:57)
	at org.testcontainers.junit.jupiter.TestcontainersExtension.lambda$startContainers$5(TestcontainersExtension.java:82)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at org.testcontainers.junit.jupiter.TestcontainersExtension.startContainers(TestcontainersExtension.java:82)
	at org.testcontainers.junit.jupiter.TestcontainersExtension.beforeAll(TestcontainersExtension.java:56)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$12(ClassBasedTestDescriptor.java:396)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:396)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:212)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:85)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:148)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:119)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:94)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:89)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:62)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at jdk.proxy2/jdk.proxy2.$Proxy5.stop(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker$3.run(TestWorker.java:193)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
	at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:113)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:65)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create cluster
	at com.redis.enterprise.testcontainers.AbstractRedisEnterpriseContainer.createCluster(AbstractRedisEnterpriseContainer.java:99)
	at com.redis.enterprise.testcontainers.RedisEnterpriseContainer.createCluster(RedisEnterpriseContainer.java:74)
	at com.redis.enterprise.testcontainers.AbstractRedisEnterpriseContainer.containerIsStarted(AbstractRedisEnterpriseContainer.java:55)
	... 77 common frames omitted
11:56:57.865 [Test worker] ERROR tc.redislabs/redis:7.4.2-129 -- Log output from the failed container:
2024-05-07 15:56:40,730 INFO Included extra file "/etc/opt/redislabs/supervisord.conf.d/supervisord_alert_mgr.conf" during parsing
2024-05-07 15:56:40,730 INFO Included extra file "/etc/opt/redislabs/supervisord.conf.d/supervisord_cm_server.conf" during parsing
2024-05-07 15:56:40,730 INFO Included extra file "/etc/opt/redislabs/supervisord.conf.d/supervisord_crdb_coordinator.conf" during parsing
2024-05-07 15:56:40,731 INFO Included extra file "/etc/opt/redislabs/supervisord.conf.d/supervisord_crdb_worker.conf" during parsing
2024-05-07 15:56:40,731 INFO Included extra file "/etc/opt/redislabs/supervisord.conf.d/supervisord_legacy_metrics_exporter.conf" during parsing
2024-05-07 15:56:40,731 INFO Included extra file "/etc/opt/redislabs/supervisord.conf.d/supervisord_mdns_server.conf" during parsing
2024-05-07 15:56:40,731 INFO Included extra file "/etc/opt/redislabs/supervisord.conf.d/supervisord_pdns_server.conf" during parsing
2024-05-07 15:56:40,731 INFO Included extra file "/etc/opt/redislabs/supervisord.conf.d/supervisord_stats_archiver.conf" during parsing
2024-05-07 15:56:40,750 INFO RPC interface 'supervisor' initialized
2024-05-07 15:56:40,750 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2024-05-07 15:56:40,750 INFO supervisord started with pid 16
2024-05-07 15:56:41,014 INFO __main__ MainThread: Waiting for REST API to be accessible
2024-05-07 15:56:41,769 INFO spawned: 'ccs' with pid 27
2024-05-07 15:56:41,774 INFO spawned: 'cluster_wd' with pid 28
2024-05-07 15:56:41,778 INFO spawned: 'envoy' with pid 29
2024-05-07 15:56:41,782 INFO spawned: 'envoy_control_plane' with pid 30
2024-05-07 15:56:41,786 INFO spawned: 'gossip_envoy' with pid 31
2024-05-07 15:56:41,790 INFO spawned: 'heartbeatd' with pid 32
2024-05-07 15:56:41,793 INFO spawned: 'ldap_agent_mgr' with pid 33
2024-05-07 15:56:41,795 INFO spawned: 'persistence_mgr' with pid 34
2024-05-07 15:56:41,797 INFO spawned: 'alert_mgr' with pid 35
2024-05-07 15:56:41,799 INFO spawned: 'cnm_exec' with pid 36
2024-05-07 15:56:41,802 INFO spawned: 'cnm_http' with pid 37
2024-05-07 15:56:41,804 INFO spawned: 'crdb_coordinator' with pid 38
2024-05-07 15:56:41,806 INFO spawned: 'crdb_worker_0' with pid 39
2024-05-07 15:56:41,808 INFO spawned: 'crdb_worker_1' with pid 40
2024-05-07 15:56:41,811 INFO spawned: 'pdns_ccs_backend' with pid 41
2024-05-07 15:56:41,812 INFO spawned: 'redis_mgr' with pid 42
2024-05-07 15:56:41,813 INFO spawned: 'resource_mgr' with pid 43
2024-05-07 15:56:41,815 INFO spawned: 'rl_info_provider' with pid 44
2024-05-07 15:56:41,817 INFO spawned: 'stats_archiver' with pid 45
2024-05-07 15:56:41,819 INFO spawned: 'cm_server' with pid 46
2024-05-07 15:56:41,821 INFO spawned: 'dmcproxy' with pid 47
2024-05-07 15:56:41,822 INFO spawned: 'mdns_server' with pid 48
2024-05-07 15:56:41,824 INFO spawned: 'pdns_server' with pid 49
2024-05-07 15:56:41,829 INFO spawned: 'sentinel_service' with pid 50
2024-05-07 15:56:41,833 INFO spawned: 'job_scheduler' with pid 51
2024-05-07 15:56:41,837 INFO spawned: 'metrics_exporter' with pid 52
2024-05-07 15:56:41,840 INFO spawned: 'node_wd' with pid 56
2024-05-07 15:56:41,845 INFO spawned: 'start_redis_servers' with pid 58
2024-05-07 15:56:41,850 INFO spawned: 'statsd_exporter' with pid 60
2024-05-07 15:56:41,925 INFO success: start_redis_servers entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-05-07 15:56:43,285 INFO success: ccs entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,286 INFO success: cluster_wd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,286 INFO success: envoy entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,288 INFO success: envoy_control_plane entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,288 INFO success: gossip_envoy entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,288 INFO success: heartbeatd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,288 INFO success: ldap_agent_mgr entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,289 INFO success: persistence_mgr entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,289 INFO success: alert_mgr entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: cnm_exec entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: cnm_http entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: crdb_coordinator entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: crdb_worker_0 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: crdb_worker_1 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: pdns_ccs_backend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: redis_mgr entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: resource_mgr entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: rl_info_provider entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: stats_archiver entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: cm_server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: dmcproxy entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: mdns_server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: pdns_server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: sentinel_service entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: metrics_exporter entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: node_wd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:43,296 INFO success: statsd_exporter entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-05-07 15:56:46,996 INFO __main__ MainThread: Done, moving to bootstrapping
2024-05-07 15:56:46,997 INFO __main__ MainThread: Bootstrapping node with action 'None'
2024-05-07 15:56:46,997 INFO __main__ MainThread: Done
2024-05-07 15:56:51,973 INFO success: job_scheduler entered RUNNING state, process has stayed up for > than 10 seconds (startsecs)

I have tried running the redislabs/redis image and directly executing the rladmin command via docker exec and hit the same connection refused error, so this may be an issue with the docker image (which is only published as amd64), but I figured I would at least create this issue in case other folks using this project have hit the same problem or have found a solution.

Cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.