testcontainers / testcontainers/testcontainers-java
Using a postgres image with mounted `/data` fails on LogWaitStrategy
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 8.7k
- フォーク
- 1.9k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 9
説明
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
modules/postgresql/src/main/java/org/testcontainers/containers/PostgreSQLContainer.java の参照されている wait-strategy の登録箇所から始め、続いて LogMessageWaitStrategy.waitUntilReady を読んでください。/data ディレクトリをマウントした PostgreSQL コンテナでこのケースを再現し、readiness timeout なしで起動が完了することを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- docker, java, postgresql
- 領域
- databases, testing
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100