From 7a0f687c00f59fd3b99fce1181c93ccce47904ec Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Fri, 27 Dec 2024 11:43:56 +0100 Subject: [PATCH] tests-e2e: Fixed previous webhook events in webhook test --- .../test/e2e/OpenViduTestAppE2eTest.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) 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 85d9d439..bd647f8f 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 @@ -3820,16 +3820,6 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest { @DisplayName("Webhook test") void webhookTest() throws Exception { - // This test occasionally fails due to leftover events in the queue from previous tests. - // To address this, we clean the queue before starting the test. - // The beforeEach method does not handle queue cleanup because the v2 compatibility - // server requires additional time after stopping a recording before it can be deleted, - // causing the beforeEach logic to be bypassed. - // To ensure stability, we add a delay and perform manual cleanup: - Thread.sleep(5000); - this.closeAllSessions(OV); - this.deleteAllRecordings(OV); - CustomWebhook.clean(); isRecordingTest = true; @@ -3848,6 +3838,17 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest { return; } + // This test occasionally fails due to leftover events in the queue from previous tests. + // To address this, we clean the queue before starting the test. + // The beforeEach method does not handle queue cleanup because the v2 compatibility + // server requires additional time after stopping a recording before it can be deleted, + // causing the beforeEach logic to be bypassed. + // To ensure stability, we add a delay and perform manual cleanup: + Thread.sleep(7000); + this.closeAllSessions(OV); + this.deleteAllRecordings(OV); + CustomWebhook.clean(); + user.getDriver().findElement(By.id("add-user-btn")).click(); user.getDriver().findElement(By.id("session-settings-btn-0")).click(); Thread.sleep(1000);