testcontainers / testcontainers/testcontainers-java
Add ability to increase default timeout for BrowserWebDriverContainer when checking if it's started
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 8.7k
- フォーク
- 1.9k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 9
説明
Hi, seems that on some slow agents we might be hitting the 30s hardcoded timeout. While we can extend BrowserWebDriverContainer to override containerIsStarted() (it's not perfect though since we cannot just copy paste the default content as it uses some private variables), it would be even nicer if the timeout could be configurable.
I'm referring to:
protected void containerIsStarted(InspectContainerResponse containerInfo) {
this.driver = (RemoteWebDriver)Unreliables.retryUntilSuccess(30, TimeUnit.SECONDS, (Callable)Timeouts.getWithTimeout(10, TimeUnit.SECONDS, () -> {
return () -> {
return new RemoteWebDriver(this.getSeleniumAddress(), this.capabilities);
};
}));
if (this.vncRecordingContainer != null) {
LOGGER.debug("Starting VNC recording");
this.vncRecordingContainer.start();
}
}
What I did FTR:
public class XWikiBrowserWebDriverContainer<T extends BrowserWebDriverContainer<T>> extends BrowserWebDriverContainer<T>
{
private Capabilities capabilities;
@Override
protected void containerIsStarted(InspectContainerResponse containerInfo)
{
Unreliables.retryUntilSuccess(60, TimeUnit.SECONDS,
Timeouts.getWithTimeout(20, TimeUnit.SECONDS,
() -> () -> new RemoteWebDriver(this.getSeleniumAddress(), this.capabilities)));
super.containerIsStarted(containerInfo);
}
@Override
public T withCapabilities(Capabilities capabilities)
{
this.capabilities = capabilities;
return super.withCapabilities(capabilities);
}
}
Thanks!
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
BrowserWebDriverContainer.containerIsStarted と、issue に示されている retry および driver-creation の経路から始めます。withCapabilities と private state がどのように使われているかを追跡し、その後、timeout を設定可能にする前に、既存の container startup テストを見つけます。遅いエージェントが private implementation details をコピーせずに startup wait を上書きできれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- docker, java
- 領域
- testing
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100