testcontainers / testcontainers/testcontainers-java

Using a postgres image with mounted `/data` fails on LogWaitStrategy

Abierto
#3,372 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

modules/postgres resolution/acknowledged type/bug
Lenguaje dominante
Java
Estrellas
8.7k
Forks
1.9k
Merge medio
2 d 17 h
PR fusionados (30 d)
9

Descripción

Testcontainer:
version: 1.14.3

Postgres:
version: 5.6-alpine
output:

PostgreSQL Database directory appears to contain a database; Skipping initialization

LOG:  database system was interrupted; last known up at 2020-10-13 08:45:54 UTC
LOG:  database system was not properly shut down; automatic recovery in progress
LOG:  redo starts at 0/14F0430
LOG:  invalid record length at 0/3356CD0: wanted 24, got 0
LOG:  redo done at 0/3356CA8
LOG:  last completed transaction was at log time 2020-10-13 08:46:42.609873+00
LOG:  MultiXact member wraparound protections are now enabled
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started

Expected behavior:

  • Container started successfully

Exception:

org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '.*database system is ready to accept connections.*\s'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:31)

Issue:
Because the image skep the initialization and the code on PostgresSQLContainer:56 is registering the LogMessageWaitStrategy to match the line ".*database system is ready to accept connections.*\\s" twice withTimes(2), the container readiness check fails.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza en modules/postgresql/src/main/java/org/testcontainers/containers/PostgreSQLContainer.java, en el registro referenciado de la wait-strategy, y luego lee LogMessageWaitStrategy.waitUntilReady. Reproduce el caso con un contenedor de PostgreSQL que use un directorio /data montado y verifica que el inicio se complete sin que se agote el tiempo de espera de readiness.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
docker, java, postgresql
Área
databases, testing
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.