From 9a85c506db40cf0d4fd74628cf16a60e24999aaa Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Tue, 10 Dec 2024 11:06:33 +0100 Subject: [PATCH] tests-e2e: Updated webhookTest --- .../openvidu/test/e2e/OpenViduTestAppE2eTest.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 9c942bca..adadd421 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 @@ -3803,6 +3803,18 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest { @Test @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(2000); + this.closeAllSessions(OV); + this.deleteAllRecordings(OV); + CustomWebhook.clean(); + isRecordingTest = true; CountDownLatch initLatch = new CountDownLatch(1); @@ -3872,7 +3884,6 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest { user.getDriver().findElement(By.id("add-user-btn")).click(); user.getDriver().findElement(By.cssSelector("#openvidu-instance-1 .join-btn")).click(); - Thread.sleep(5000); event = CustomWebhook.waitForEvent("participantJoined", 2); CustomWebhook.waitForEvent("webrtcConnectionCreated", 12); // NO SUBSCRIBERS