testcontainers / testcontainers/testcontainers-java

Add ability to increase default timeout for BrowserWebDriverContainer when checking if it's started

Đang mở
#3,161 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Java
Star
8.7k
Fork
1.9k
Merge trung bình
2 ngày 17 giờ
Pull request đã merge (30 ngày)
9

Mô tả

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!

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với BrowserWebDriverContainer.containerIsStarted và đường dẫn retry và tạo driver được nêu trong issue. Theo dõi cách withCapabilities và trạng thái private được sử dụng, sau đó tìm các kiểm thử khởi động container hiện có trước khi làm cho timeout có thể cấu hình. Được xem là hoàn tất khi các agent chậm có thể ghi đè thời gian chờ khởi động mà không sao chép các chi tiết triển khai private.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
docker, java
Lĩnh vực
testing
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.