From 023c1c188f0bc8054bd7bd420ed6e63c4ba1053a Mon Sep 17 00:00:00 2001 From: cruizba Date: Tue, 10 Dec 2024 14:04:32 +0100 Subject: [PATCH] Revert "e2e: increate delay to setup some browser tests" This reverts commit 7e45b027de6abf25914ed63580966fb2382a9edd. --- .../io/openvidu/test/e2e/OpenViduTestE2e.java | 28 ++++++++----------- .../e2e/AbstractOpenViduTestappE2eTest.java | 10 +------ .../test/e2e/OpenViduTestAppE2eTest.java | 8 +++--- 3 files changed, 17 insertions(+), 29 deletions(-) diff --git a/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/OpenViduTestE2e.java b/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/OpenViduTestE2e.java index 14797b5399..64053facf9 100644 --- a/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/OpenViduTestE2e.java +++ b/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/OpenViduTestE2e.java @@ -376,10 +376,6 @@ protected static void loadEnvironmentVariables() { } protected BrowserUser setupBrowser(String browser) throws Exception { - return setupBrowser(browser, 5000); - } - - protected BrowserUser setupBrowser(String browser, long startDelay) throws Exception { BrowserUser browserUser = null; GenericContainer container; @@ -388,58 +384,58 @@ protected BrowserUser setupBrowser(String browser, long startDelay) throws Excep switch (browser) { case "chrome": container = chromeContainer("selenium/standalone-chrome:" + CHROME_VERSION, 2147483648L, 1, true); - setupBrowserAux(BrowserNames.CHROME, container, false, startDelay); + setupBrowserAux(BrowserNames.CHROME, container, false); browserUser = new ChromeUser("TestUser", 50, true); break; case "chromeTwoInstances": container = chromeContainer("selenium/standalone-chrome:" + CHROME_VERSION, 2147483648L, 2, true); - setupBrowserAux(BrowserNames.CHROME, container, false, startDelay); + setupBrowserAux(BrowserNames.CHROME, container, false); browserUser = new ChromeUser("TestUser", 50, true); break; case "chromeAlternateScreenShare": container = chromeContainer("selenium/standalone-chrome:" + CHROME_VERSION, 2147483648L, 1, false); - setupBrowserAux(BrowserNames.CHROME, container, false, startDelay); + setupBrowserAux(BrowserNames.CHROME, container, false); browserUser = new ChromeUser("TestUser", 50, "OpenVidu TestApp"); break; case "chromeAlternateFakeVideo": container = chromeContainer("selenium/standalone-chrome:" + CHROME_VERSION, 2147483648L, 1, true); - setupBrowserAux(BrowserNames.CHROME, container, false, startDelay); + setupBrowserAux(BrowserNames.CHROME, container, false); path = Paths.get("/opt/openvidu/barcode.y4m"); checkMediafilePath(path); browserUser = new ChromeUser("TestUser", 50, path); break; case "chromeFakeAudio": container = chromeContainer("selenium/standalone-chrome:" + CHROME_VERSION, 2147483648L, 1, true); - setupBrowserAux(BrowserNames.CHROME, container, false, startDelay); + setupBrowserAux(BrowserNames.CHROME, container, false); path = Paths.get("/opt/openvidu/stt-test.wav"); checkMediafilePath(path); browserUser = new ChromeUser("TestUser", 50, null, path); break; case "chromeVirtualBackgroundFakeVideo": container = chromeContainer("selenium/standalone-chrome:" + CHROME_VERSION, 2147483648L, 1, false); - setupBrowserAux(BrowserNames.CHROME, container, false, startDelay); + setupBrowserAux(BrowserNames.CHROME, container, false); path = Paths.get("/opt/openvidu/girl.mjpeg"); checkMediafilePath(path); browserUser = new ChromeUser("TestUser", 50, path, false); break; case "firefox": container = firefoxContainer("selenium/standalone-firefox:" + FIREFOX_VERSION, 2147483648L, 1, true); - setupBrowserAux(BrowserNames.FIREFOX, container, false, startDelay); + setupBrowserAux(BrowserNames.FIREFOX, container, false); browserUser = new FirefoxUser("TestUser", 50, false); break; case "firefoxDisabledOpenH264": container = firefoxContainer("selenium/standalone-firefox:" + FIREFOX_VERSION, 2147483648L, 1, true); - setupBrowserAux(BrowserNames.FIREFOX, container, false, startDelay); + setupBrowserAux(BrowserNames.FIREFOX, container, false); browserUser = new FirefoxUser("TestUser", 50, true); break; case "opera": container = operaContainer("selenium/standalone-opera:" + OPERA_VERSION, 2147483648L, 1); - setupBrowserAux(BrowserNames.OPERA, container, false, startDelay); + setupBrowserAux(BrowserNames.OPERA, container, false); browserUser = new OperaUser("TestUser", 50); break; case "edge": container = edgeContainer("selenium/standalone-edge:" + EDGE_VERSION, 2147483648L, 1, true); - setupBrowserAux(BrowserNames.EDGE, container, false, startDelay); + setupBrowserAux(BrowserNames.EDGE, container, false); browserUser = new EdgeUser("TestUser", 50); break; case "androidChrome": @@ -466,7 +462,7 @@ protected BrowserUser setupBrowser(String browser, long startDelay) throws Excep return browserUser; } - private static boolean setupBrowserAux(BrowserNames browser, GenericContainer container, boolean forceRestart, long startDelay) { + private static boolean setupBrowserAux(BrowserNames browser, GenericContainer container, boolean forceRestart) { if (isRemote(browser)) { String dockerImage = container.getDockerImageName(); String ps = commandLine.executeCommand("docker ps | grep " + dockerImage, 30); @@ -491,7 +487,7 @@ private static boolean setupBrowserAux(BrowserNames browser, GenericContainer protected static GenericContainer setupDockerAndroidContainer() throws Exception { GenericContainer container = androidContainer(DOCKER_ANDROID_IMAGE, 4294967296L); - boolean newContainer = setupBrowserAux(BrowserNames.ANDROID, container, false, 5000); + boolean newContainer = setupBrowserAux(BrowserNames.ANDROID, container, false); if (!newContainer) { container = containers.stream().filter(c -> DOCKER_ANDROID_IMAGE.equals(c.getDockerImageName())).findFirst() .get(); diff --git a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/AbstractOpenViduTestappE2eTest.java b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/AbstractOpenViduTestappE2eTest.java index aa47288720..17f4ea776b 100644 --- a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/AbstractOpenViduTestappE2eTest.java +++ b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/AbstractOpenViduTestappE2eTest.java @@ -28,15 +28,7 @@ private void connectToOpenViduTestApp(OpenViduTestappUser user) { } protected OpenViduTestappUser setupBrowserAndConnectToOpenViduTestapp(String browser) throws Exception { - BrowserUser browserUser = this.setupBrowser(browser, 5000); - OpenViduTestappUser testappUser = new OpenViduTestappUser(browserUser); - this.testappUsers.add(testappUser); - this.connectToOpenViduTestApp(testappUser); - return testappUser; - } - - protected OpenViduTestappUser setupBrowserAndConnectToOpenViduTestapp(String browser, long startDelay) throws Exception { - BrowserUser browserUser = this.setupBrowser(browser, startDelay); + BrowserUser browserUser = this.setupBrowser(browser); OpenViduTestappUser testappUser = new OpenViduTestappUser(browserUser); this.testappUsers.add(testappUser); this.connectToOpenViduTestApp(testappUser); diff --git a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java index 96c6c8197b..f855bb5587 100644 --- a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java +++ b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java @@ -154,7 +154,7 @@ void oneToOneOpera() throws Exception { @Test @DisplayName("One2One Edge") void oneToOneEdge() throws Exception { - OpenViduTestappUser user = setupBrowserAndConnectToOpenViduTestapp("edge", 20000); + OpenViduTestappUser user = setupBrowserAndConnectToOpenViduTestapp("edge"); log.info("One2One Edge"); oneToOneAux(user); } @@ -453,7 +453,7 @@ public void uncaughtException(Thread th, Throwable ex) { Thread threadChrome = new Thread(() -> { try { - browserTest.apply(setupBrowserAndConnectToOpenViduTestapp("chrome", 20000), "Chrome"); + browserTest.apply(setupBrowserAndConnectToOpenViduTestapp("chrome"), "Chrome"); } catch (Exception e) { String errMsg = "Error setting up browser: " + e.getMessage(); System.err.println(errMsg); @@ -463,7 +463,7 @@ public void uncaughtException(Thread th, Throwable ex) { }); Thread threadFirefox = new Thread(() -> { try { - browserTest.apply(setupBrowserAndConnectToOpenViduTestapp("firefox", 20000), "Firefox"); + browserTest.apply(setupBrowserAndConnectToOpenViduTestapp("firefox"), "Firefox"); } catch (Exception e) { String errMsg = "Error setting up browser: " + e.getMessage(); System.err.println(errMsg); @@ -473,7 +473,7 @@ public void uncaughtException(Thread th, Throwable ex) { }); Thread threadEdge = new Thread(() -> { try { - browserTest.apply(setupBrowserAndConnectToOpenViduTestapp("edge", 20000), "Edge"); + browserTest.apply(setupBrowserAndConnectToOpenViduTestapp("edge"), "Edge"); } catch (Exception e) { String errMsg = "Error setting up browser: " + e.getMessage(); System.err.println(errMsg);