Jenkinsfile: do not remove stranded containers at finally

pull/658/head
pabloFuente 2021-10-31 15:36:00 +01:00
parent a30fd89d85
commit 83a71e41ab
3 changed files with 5 additions and 19 deletions

View File

@ -165,7 +165,6 @@ node('container') {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
} finally { } finally {
environmentStop() environmentStop()
commonFunctions.removeStrandedContainers()
} }
} }
} }

View File

@ -269,16 +269,14 @@ public class AbstractOpenViduTestAppE2eTest {
protected void closeAllSessions(OpenVidu client) { protected void closeAllSessions(OpenVidu client) {
try { try {
client.fetch(); client.fetch();
} catch (OpenViduJavaClientException | OpenViduHttpException e1) { } catch (OpenViduJavaClientException | OpenViduHttpException e) {
log.error("Error fetching sessions: {}", e1.getMessage()); log.error("Error fetching sessions: {}", e.getMessage());
} }
client.getActiveSessions().forEach(session -> { client.getActiveSessions().forEach(session -> {
try { try {
session.close(); session.close();
log.info("Session {} successfully closed", session.getSessionId()); log.info("Session {} successfully closed", session.getSessionId());
} catch (OpenViduJavaClientException e) { } catch (OpenViduJavaClientException | OpenViduHttpException e) {
log.error("Error closing session: {}", e.getMessage());
} catch (OpenViduHttpException e) {
log.error("Error closing session: {}", e.getMessage()); log.error("Error closing session: {}", e.getMessage());
} }
}); });
@ -290,9 +288,7 @@ public class AbstractOpenViduTestAppE2eTest {
try { try {
client.deleteRecording(recording.getId()); client.deleteRecording(recording.getId());
log.info("Recording {} successfully deleted", recording.getId()); log.info("Recording {} successfully deleted", recording.getId());
} catch (OpenViduJavaClientException e) { } catch (OpenViduJavaClientException | OpenViduHttpException e) {
log.error("Error deleting recording: {}", e.getMessage());
} catch (OpenViduHttpException e) {
log.error("Error deleting recording: {}", e.getMessage()); log.error("Error deleting recording: {}", e.getMessage());
} }
}); });

View File

@ -190,8 +190,6 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestAppE2eTest {
user.getEventManager().waitUntilEventReaches("streamCreated", 4); user.getEventManager().waitUntilEventReaches("streamCreated", 4);
user.getEventManager().waitUntilEventReaches("streamPlaying", 4); user.getEventManager().waitUntilEventReaches("streamPlaying", 4);
System.out.println(this.getBase64Screenshot(user));
final int numberOfVideos = user.getDriver().findElements(By.tagName("video")).size(); final int numberOfVideos = user.getDriver().findElements(By.tagName("video")).size();
Assert.assertEquals("Expected 4 videos but found " + numberOfVideos, 4, numberOfVideos); Assert.assertEquals("Expected 4 videos but found " + numberOfVideos, 4, numberOfVideos);
Assert.assertTrue("Videos were expected to only have audio tracks", user.getEventManager() Assert.assertTrue("Videos were expected to only have audio tracks", user.getEventManager()
@ -1925,7 +1923,6 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestAppE2eTest {
user.getDriver().findElement(By.id("get-session-btn")).click(); user.getDriver().findElement(By.id("get-session-btn")).click();
Thread.sleep(1000); Thread.sleep(1000);
System.out.println(getBase64Screenshot(user));
System.out.println(user.getDriver().findElement(By.id("api-response-text-area")).getAttribute("value")); System.out.println(user.getDriver().findElement(By.id("api-response-text-area")).getAttribute("value"));
user.getWaiter() user.getWaiter()
@ -3336,7 +3333,7 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestAppE2eTest {
@Test @Test
@DisplayName("Media server reconnect active session no streams test") @DisplayName("Media server reconnect active session no streams test")
void mediaServerReconnectActiveSessionNoSteamsTest() throws Exception { void mediaServerReconnectActiveSessionNoStreamsTest() throws Exception {
isKurentoRestartTest = true; isKurentoRestartTest = true;
log.info("Media server reconnect active session no streams test"); log.info("Media server reconnect active session no streams test");
@ -3433,12 +3430,6 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestAppE2eTest {
user.getEventManager().waitUntilEventReaches("streamCreated", 2); user.getEventManager().waitUntilEventReaches("streamCreated", 2);
user.getEventManager().waitUntilEventReaches("streamPlaying", 2); user.getEventManager().waitUntilEventReaches("streamPlaying", 2);
this.closeAllSessions(OV);
CustomWebhook.waitForEvent("sessionDestroyed", 2);
user.getDriver().findElement(By.id("remove-all-users-btn")).click();
user.getEventManager().clearAllCurrentEvents();
CustomWebhook.clean();
} finally { } finally {
CustomWebhook.shutDown(); CustomWebhook.shutDown();
} }