JdbcDatabaseContainer ignores set WaitStrategy

オープン
#2,994 コメント 6 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
docker, java
領域
testing

調査の方向性

JdbcDatabaseContainer で、オーバーライドされた waitUntilContainerStarted() メソッドと、GenericContainer が waitingFor() をどのように適用するかを確認します。先頭にスーパークラスの呼び出しを追加し、その後、設定された WaitStrategy がデータベース接続のチェックより前に実行されることを検証します。この issue では特定のテストファイルは指定されていません。

索引モデルが issue の本文から書いたものです。

説明

The JdbcDatabaseContainer overwirtes the method waitUntilContainerStarted() of GenericContainer but does not call super.waitUntilContainerStarted(). So the WaitStrategy set via waitingFor() is not applied. This is really confusing because you wonder why the set WaitStrategy is not called.

Please add super.waitUntilContainerStarted() at the beginning of waitUntilContainerStarted() in JdbcDatabaseContainer. E.g.:

@Override
protected void waitUntilContainerStarted() {
    super.waitUntilContainerStarted();

    logger().info("Waiting for database connection to become available at {} using query '{}'", getJdbcUrl(), getTestQueryString());

    // Repeatedly try and open a connection to the DB and execute a test query
    ....
主要言語
Java
スター
8.7k
フォーク
1.9k
平均マージ
2日 17時間
マージ済み PR(30日)
9

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

testcontainers/testcontainers-java のほかの issue

testcontainers/testcontainers-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。