File tree Expand file tree Collapse file tree
modules/selenium/src/main/java/org/testcontainers/containers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
66- Fixed the case when disk's size is bigger than Integer's max value (#379 , #380 )
77- Fix erroneous version reference used during CI testing of shaded dependencies
88- Fix leakage of Vibur and Tomcat JDBC test dependencies in ` jdbc-test ` and ` mysql ` modules (#382 )
9+ - Add timeout and retries for creation of ` RemoteWebDriver ` (#381 , #373 , #257 )
910
1011### Changed
1112- Added support for Docker networks (#372 )
Original file line number Diff line number Diff line change 66import org .openqa .selenium .remote .BrowserType ;
77import org .openqa .selenium .remote .DesiredCapabilities ;
88import org .openqa .selenium .remote .RemoteWebDriver ;
9+ import org .rnorth .ducttape .timeouts .Timeouts ;
10+ import org .rnorth .ducttape .unreliables .Unreliables ;
911import org .slf4j .Logger ;
1012import org .slf4j .LoggerFactory ;
1113import org .testcontainers .containers .traits .LinkableContainer ;
2022import java .util .ArrayList ;
2123import java .util .Collection ;
2224import java .util .Date ;
25+ import java .util .concurrent .TimeUnit ;
2326
2427import static com .google .common .base .Preconditions .checkState ;
2528import static java .time .temporal .ChronoUnit .SECONDS ;
@@ -157,7 +160,11 @@ protected void containerIsStarted(InspectContainerResponse containerInfo) {
157160 recordingSidekickContainer .start ();
158161 currentVncRecordings .add (recordingSidekickContainer );
159162 }
160- this .driver = new RemoteWebDriver (getSeleniumAddress (), desiredCapabilities );
163+
164+ driver = Unreliables .retryUntilSuccess (30 , TimeUnit .SECONDS ,
165+ Timeouts .getWithTimeout (10 , TimeUnit .SECONDS ,
166+ () ->
167+ () -> new RemoteWebDriver (getSeleniumAddress (), desiredCapabilities )));
161168 }
162169
163170 /**
You can’t perform that action at this time.
0 commit comments