testcontainers / testcontainers/testcontainers-java
[Enhancement]: Reduce exceptions caused by Unreliables.retryUntilTrue
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 8.7k
- フォーク
- 1.9k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 9
説明
Module
Core
Proposal
Hi 👋
I've been profiling test pipelines in our in-house projects and noticed on several Spring-Boot related projects that use DockerComposeContainer that a large amount of exceptions is thrown when waiting for the containers to start.

Throwing RuntimeExceptions with the message "Not ready yet" is not really exceptional here - on the contrary. It's rather the norm. I can't imagine this to be super efficient. It would be great if an alternative solution could be implemented that isn't based on exceptions. Or short-term alternative: throwing a dedicate exception with fillInStackTrace overridden to at least avoid the overhead of generating the stacktrace.
class NotReadyYetException extends RuntimeException {
public NotReadyYetException() {
super("Not ready yet");
}
@Override
public synchronized Throwable fillInStackTrace() {
return this;
}
}
Or caching the exception....
Because duct-tape seems to be read only, I hope this is the correct place for this report. Please lead me to the correct place if not. I'm also open to provide the short term solution somewhere if you want me to and you think this is worthwhile.
Let me know what you think.
Cheers,
Christoph
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、Unreliables.retryUntilTrue のエントリーポイントと、コンテナの待機時に DockerComposeContainer がそれを使用する箇所を追跡します。現在の例外ベースの再試行動作を、提案されている例外を使用しない経路または stacktrace のない例外と比較し、そのうえで、readiness の動作を変更せずに例外オーバーヘッドを測定可能な形で削減できることを定義してテストします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- docker, docker-compose, java
- 領域
- testing
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100