Skip to content

Commit

Permalink
Selenium: increase default startup timeout to 60 seconds (#4357)
Browse files Browse the repository at this point in the history
Co-authored-by: Eddú Meléndez Gonzales <eddu.melendez@gmail.com>
  • Loading branch information
Aloren and eddumelendez committed Nov 28, 2023
1 parent 101b6a7 commit 77cd560
Showing 1 changed file with 15 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,7 @@ public class BrowserWebDriverContainer<SELF extends BrowserWebDriverContainer<SE

public BrowserWebDriverContainer() {
super();
final WaitStrategy logWaitStrategy = new LogMessageWaitStrategy()
.withRegEx(
".*(RemoteWebDriver instances should connect to|Selenium Server is up and running|Started Selenium Standalone).*\n"
)
.withStartupTimeout(Duration.of(15, ChronoUnit.SECONDS));

this.waitStrategy =
new WaitAllStrategy()
.withStrategy(logWaitStrategy)
.withStrategy(new HostPortWaitStrategy())
.withStartupTimeout(Duration.of(15, ChronoUnit.SECONDS));
this.waitStrategy = getDefaultWaitStrategy();

this.withRecordingFileFactory(new DefaultRecordingFileFactory());
}
Expand All @@ -134,17 +124,7 @@ public BrowserWebDriverContainer(DockerImageName dockerImageName) {
super(dockerImageName);
// we assert compatibility with the chrome/firefox/edge image later, after capabilities are processed

final WaitStrategy logWaitStrategy = new LogMessageWaitStrategy()
.withRegEx(
".*(RemoteWebDriver instances should connect to|Selenium Server is up and running|Started Selenium Standalone).*\n"
)
.withStartupTimeout(Duration.of(15, ChronoUnit.SECONDS));

this.waitStrategy =
new WaitAllStrategy()
.withStrategy(logWaitStrategy)
.withStrategy(new HostPortWaitStrategy())
.withStartupTimeout(Duration.of(15, ChronoUnit.SECONDS));
this.waitStrategy = getDefaultWaitStrategy();

this.withRecordingFileFactory(new DefaultRecordingFileFactory());

Expand Down Expand Up @@ -453,6 +433,19 @@ public SELF withRecordingFileFactory(RecordingFileFactory recordingFileFactory)
return self();
}

private WaitStrategy getDefaultWaitStrategy() {
final WaitStrategy logWaitStrategy = new LogMessageWaitStrategy()
.withRegEx(
".*(RemoteWebDriver instances should connect to|Selenium Server is up and running|Started Selenium Standalone).*\n"
)
.withStartupTimeout(Duration.of(60, ChronoUnit.SECONDS));

return new WaitAllStrategy()
.withStrategy(logWaitStrategy)
.withStrategy(new HostPortWaitStrategy())
.withStartupTimeout(Duration.of(60, ChronoUnit.SECONDS));
}

public enum VncRecordingMode {
SKIP,
RECORD_ALL,
Expand Down

0 comments on commit 77cd560

Please sign in to comment.