Skip to content

Commit 520cfeb

Browse files
authored
Disable Chrome's GPU support in BrowserWebDriverContainer (#4315)
* Trigger selenium build on CI * Try again to trigger build * Apply potential fix by disabling GPU * Also --disable-dev-shm-usage * Alwas add disable-gpu flag * Smaller check for hack * Smaller check for hack
1 parent 38a443f commit 520cfeb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

modules/selenium/src/main/java/org/testcontainers/containers/BrowserWebDriverContainer.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,13 @@ protected void configure() {
166166
}
167167
}
168168

169+
// Hack for new selenium-chrome image that contains Chrome 92.
170+
// If not disabled, container startup will fail in most cases and consume excessive amounts of CPU.
171+
if (capabilities instanceof ChromeOptions) {
172+
ChromeOptions options = (ChromeOptions) this.capabilities;
173+
options.addArguments("--disable-gpu");
174+
}
175+
169176
if (recordingMode != VncRecordingMode.SKIP) {
170177

171178
if (vncRecordingDirectory == null) {

0 commit comments

Comments
 (0)