From 445792f68df2d6f64a0b517103867719b9a1fc11 Mon Sep 17 00:00:00 2001 From: danhuawang <154112360+danhuawang@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:41:30 +0800 Subject: [PATCH] [Minor] Frontend integration test failed in headless environment (#4006) ### What changes were proposed in this pull request? Frontend integration test failed in certain headless environment, like the ec2 in aws. ### Why are the changes needed? Frontend integration test failed due to the following error: ``` MetalakePageTest > initializationError FAILED org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally. (chrome not reachable) (The process started from chrome location /actions-runner/_work/gravitino-test/gravitino-test/gravitino/integration-test/build/chrome/chrome-linux/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'ip-172-31-5-251', ip: '172.31.5.251', os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-1020-aws', java.version: '1.8.0_412' Driver info: driver.version: ChromeDriver remote stacktrace: #0 0x561b8bc79869 #1 0x561b8bc14383 #2 0x561b8b9f6ca3 #3 0x561b8ba1a286 #4 0x561b8ba157cd #5 0x561b8ba4f11d #6 0x561b8ba49963 #7 0x561b8ba1fe36 #8 0x561b8ba20fd5 #9 0x561b8bc41f90 #10 0x561b8bc53d80 ``` ### Does this PR introduce _any_ user-facing change? N/A ### How was this patch tested? image --- .../integration/test/web/ui/utils/ChromeWebDriverProvider.java | 1 + 1 file changed, 1 insertion(+) diff --git a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/utils/ChromeWebDriverProvider.java b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/utils/ChromeWebDriverProvider.java index dbbd588ba0d..42162d900a8 100644 --- a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/utils/ChromeWebDriverProvider.java +++ b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/utils/ChromeWebDriverProvider.java @@ -91,6 +91,7 @@ public WebDriver createWebDriver() { // Display the web interface during testing if (Strings.isEmpty(System.getenv("DISPLAY_WEBPAGE_IN_TESTING"))) { chromeOptions.addArguments("--headless"); + chromeOptions.addArguments("--no-sandbox"); } if (SystemUtils.IS_OS_MAC_OSX) {