mirror of https://github.com/OpenVidu/openvidu.git
Add massive session e2e test
parent
bdb34e7221
commit
d49ec43236
|
@ -393,14 +393,16 @@ public abstract class KmsManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void nodeRecoveredHandler(Kms kms) {
|
public void nodeRecoveredHandler(Kms kms) {
|
||||||
log.info("According to Timer KMS with uri {} and KurentoClient [{}] is now reconnected", kms.getUri(),
|
|
||||||
kms.getKurentoClient().toString());
|
|
||||||
|
|
||||||
kms.getKurentoClientReconnectTimer().cancelTimer();
|
|
||||||
|
|
||||||
final boolean mustTriggerNodeRecoveredEvent = kms.hasTriggeredNodeCrashedEvent();
|
final boolean mustTriggerNodeRecoveredEvent = kms.hasTriggeredNodeCrashedEvent();
|
||||||
final long timeOfKurentoDisconnection = kms.getTimeOfKurentoClientDisconnection();
|
final long timeOfKurentoDisconnection = kms.getTimeOfKurentoClientDisconnection();
|
||||||
|
|
||||||
|
log.info("According to Timer KMS with uri {} and KurentoClient [{}] is now reconnected after {} ms",
|
||||||
|
kms.getUri(), kms.getKurentoClient().toString(),
|
||||||
|
(System.currentTimeMillis() - timeOfKurentoDisconnection));
|
||||||
|
|
||||||
|
kms.getKurentoClientReconnectTimer().cancelTimer();
|
||||||
|
|
||||||
kms.setKurentoClientConnected(true, true);
|
kms.setKurentoClientConnected(true, true);
|
||||||
|
|
||||||
if (kms.getKurentoSessions().isEmpty()) {
|
if (kms.getKurentoSessions().isEmpty()) {
|
||||||
|
|
|
@ -402,6 +402,36 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest {
|
||||||
gracefullyLeaveParticipants(user, 4);
|
gracefullyLeaveParticipants(user, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Massive session")
|
||||||
|
void massiveSessionTest() throws Exception {
|
||||||
|
isKurentoRestartTest = true;
|
||||||
|
|
||||||
|
OpenViduTestappUser user = setupBrowserAndConnectToOpenViduTestapp("chrome");
|
||||||
|
|
||||||
|
log.info("Massive session");
|
||||||
|
|
||||||
|
final Integer NUMBER_OF_USERS = 7;
|
||||||
|
|
||||||
|
user.getDriver().findElement(By.id("toolbar-scenarios")).sendKeys(Keys.ENTER);
|
||||||
|
|
||||||
|
WebElement one2ManyInput = user.getDriver().findElement(By.id("one2many-input"));
|
||||||
|
one2ManyInput.clear();
|
||||||
|
one2ManyInput.sendKeys(NUMBER_OF_USERS.toString());
|
||||||
|
|
||||||
|
user.getDriver().findElement(By.id("one2many-btn")).click();
|
||||||
|
|
||||||
|
user.getWaiter()
|
||||||
|
.until(ExpectedConditions.numberOfElementsToBe(By.tagName("video"), NUMBER_OF_USERS * NUMBER_OF_USERS));
|
||||||
|
|
||||||
|
user.getEventManager().waitUntilEventReaches("streamCreated", NUMBER_OF_USERS * NUMBER_OF_USERS);
|
||||||
|
user.getEventManager().waitUntilEventReaches("streamPlaying", NUMBER_OF_USERS * NUMBER_OF_USERS);
|
||||||
|
|
||||||
|
this.stopMediaServer(false);
|
||||||
|
|
||||||
|
user.getEventManager().waitUntilEventReaches("sessionDisconnected", NUMBER_OF_USERS);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisplayName("Cross-Browser test")
|
@DisplayName("Cross-Browser test")
|
||||||
void crossBrowserTest() throws Exception {
|
void crossBrowserTest() throws Exception {
|
||||||
|
|
|
@ -22,11 +22,11 @@
|
||||||
"@angular/router": "14.2.12",
|
"@angular/router": "14.2.12",
|
||||||
"colormap": "2.3.2",
|
"colormap": "2.3.2",
|
||||||
"core-js": "3.26.1",
|
"core-js": "3.26.1",
|
||||||
"json-stringify-safe": "^5.0.1",
|
"json-stringify-safe": "5.0.1",
|
||||||
"openvidu-browser": "2.24.0",
|
"openvidu-browser": "2.24.0",
|
||||||
"openvidu-node-client": "2.24.0",
|
"openvidu-node-client": "2.24.0",
|
||||||
"rxjs": "7.5.7",
|
"rxjs": "7.5.7",
|
||||||
"tslib": "^2.4.1",
|
"tslib": "2.4.1",
|
||||||
"zone.js": "0.12.0"
|
"zone.js": "0.12.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -40,8 +40,8 @@
|
||||||
"@types/node": "12.12.14",
|
"@types/node": "12.12.14",
|
||||||
"codelyzer": "6.0.2",
|
"codelyzer": "6.0.2",
|
||||||
"ts-node": "8.5.4",
|
"ts-node": "8.5.4",
|
||||||
"tslint": "~6.1.3",
|
"tslint": "6.1.3",
|
||||||
"typescript": "4.6.4"
|
"typescript": "4.8.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@adobe/css-tools": {
|
"node_modules/@adobe/css-tools": {
|
||||||
|
@ -10987,9 +10987,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "4.6.4",
|
"version": "4.8.4",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
|
||||||
"integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==",
|
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
|
@ -19557,9 +19557,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "4.6.4",
|
"version": "4.8.4",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
|
||||||
"integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==",
|
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"unicode-canonical-property-names-ecmascript": {
|
"unicode-canonical-property-names-ecmascript": {
|
||||||
|
|
|
@ -13,11 +13,11 @@
|
||||||
"@angular/router": "14.2.12",
|
"@angular/router": "14.2.12",
|
||||||
"colormap": "2.3.2",
|
"colormap": "2.3.2",
|
||||||
"core-js": "3.26.1",
|
"core-js": "3.26.1",
|
||||||
"json-stringify-safe": "^5.0.1",
|
"json-stringify-safe": "5.0.1",
|
||||||
"openvidu-browser": "2.24.0",
|
"openvidu-browser": "2.24.0",
|
||||||
"openvidu-node-client": "2.24.0",
|
"openvidu-node-client": "2.24.0",
|
||||||
"rxjs": "7.5.7",
|
"rxjs": "7.5.7",
|
||||||
"tslib": "^2.4.1",
|
"tslib": "2.4.1",
|
||||||
"zone.js": "0.12.0"
|
"zone.js": "0.12.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -27,12 +27,12 @@
|
||||||
"@angular/language-service": "14.2.12",
|
"@angular/language-service": "14.2.12",
|
||||||
"@types/jasmine": "4.3.0",
|
"@types/jasmine": "4.3.0",
|
||||||
"@types/jasminewd2": "2.0.10",
|
"@types/jasminewd2": "2.0.10",
|
||||||
"@types/json-stringify-safe": "^5.0.0",
|
"@types/json-stringify-safe": "5.0.0",
|
||||||
"@types/node": "12.12.14",
|
"@types/node": "12.12.14",
|
||||||
"codelyzer": "6.0.2",
|
"codelyzer": "6.0.2",
|
||||||
"ts-node": "8.5.4",
|
"ts-node": "8.5.4",
|
||||||
"tslint": "~6.1.3",
|
"tslint": "6.1.3",
|
||||||
"typescript": "4.6.4"
|
"typescript": "4.8.4"
|
||||||
},
|
},
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"name": "openvidu-testapp",
|
"name": "openvidu-testapp",
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
<mat-toolbar class="mat-elevation-z5" color="primary">
|
<mat-toolbar class="mat-elevation-z5" color="primary">
|
||||||
<div layout-align='center center' layout='column'>
|
<div layout-align='center center' layout='column'>
|
||||||
<a id="nav-logo" routerLink="/"><img id="nav-img" src="assets/images/openvidu_vert_white_bg_trans_cropped.png"/> TestApp</a>
|
<a id="nav-logo" routerLink="/"><img id="nav-img" src="assets/images/openvidu_vert_white_bg_trans_cropped.png"/> TestApp</a>
|
||||||
<a mat-button routerLink="/test-sessions"><span>SESSIONS</span></a>
|
<a mat-button id="toolbar-sessions" routerLink="/test-sessions"><span>SESSIONS</span></a>
|
||||||
<a mat-button routerLink="/test-scenarios"><span>SCENARIOS</span></a>
|
<a mat-button id="toolbar-scenarios" routerLink="/test-scenarios"><span>SCENARIOS</span></a>
|
||||||
<a mat-button routerLink="/test-apirest"><span>API REST</span></a>
|
<a mat-button id="toolbar-apirest" routerLink="/test-apirest"><span>API REST</span></a>
|
||||||
</div>
|
</div>
|
||||||
</mat-toolbar>
|
</mat-toolbar>
|
||||||
<main>
|
<main>
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { StreamManagerWrapper } from '../users-table/table-video.component';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import {
|
import {
|
||||||
ConnectionEvent, OpenVidu, PublisherProperties, Session,
|
ConnectionEvent, OpenVidu, PublisherProperties, Session,
|
||||||
|
SessionDisconnectedEvent,
|
||||||
StreamEvent,
|
StreamEvent,
|
||||||
StreamManagerEvent
|
StreamManagerEvent
|
||||||
} from 'openvidu-browser';
|
} from 'openvidu-browser';
|
||||||
|
@ -183,6 +184,10 @@ export class TestScenariosComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
const OV = new OpenVidu();
|
const OV = new OpenVidu();
|
||||||
|
|
||||||
|
OV.setAdvancedConfiguration({
|
||||||
|
noStreamPlayingEventExceptionTimeout: 50000
|
||||||
|
});
|
||||||
|
|
||||||
if (this.turnConf === 'freeice') {
|
if (this.turnConf === 'freeice') {
|
||||||
OV.setAdvancedConfiguration({ iceServers: 'freeice' });
|
OV.setAdvancedConfiguration({ iceServers: 'freeice' });
|
||||||
} else if (this.turnConf === 'manual') {
|
} else if (this.turnConf === 'manual') {
|
||||||
|
@ -199,8 +204,15 @@ export class TestScenariosComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
session.on('sessionDisconnected', (event: SessionDisconnectedEvent) => {
|
||||||
|
this.testFeedService.pushNewEvent({ user: 0, event });
|
||||||
|
});
|
||||||
|
|
||||||
if (user.subscribeTo) {
|
if (user.subscribeTo) {
|
||||||
session.on('streamCreated', (event: StreamEvent) => {
|
session.on('streamCreated', (event: StreamEvent) => {
|
||||||
|
|
||||||
|
this.testFeedService.pushNewEvent({ user: 0, event });
|
||||||
|
|
||||||
const subscriber = session.subscribe(event.stream, undefined, (error) => {
|
const subscriber = session.subscribe(event.stream, undefined, (error) => {
|
||||||
const subAux = this.subscribers
|
const subAux = this.subscribers
|
||||||
.find(s => s.connectionId === session.connection.connectionId).subs
|
.find(s => s.connectionId === session.connection.connectionId).subs
|
||||||
|
@ -233,6 +245,9 @@ export class TestScenariosComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
subscriber.on('streamPlaying', (e: StreamManagerEvent) => {
|
subscriber.on('streamPlaying', (e: StreamManagerEvent) => {
|
||||||
|
|
||||||
|
this.testFeedService.pushNewEvent({ user: 0, event: e });
|
||||||
|
|
||||||
this.subscribers
|
this.subscribers
|
||||||
.find(s => s.connectionId === session.connection.connectionId).subs
|
.find(s => s.connectionId === session.connection.connectionId).subs
|
||||||
.find(s => s.streamManager.stream.connection.connectionId === subscriber.stream.connection.connectionId)
|
.find(s => s.streamManager.stream.connection.connectionId === subscriber.stream.connection.connectionId)
|
||||||
|
@ -253,10 +268,12 @@ export class TestScenariosComponent implements OnInit, OnDestroy {
|
||||||
state: { 'connecting': (Date.now() - startTimeForUser) }
|
state: { 'connecting': (Date.now() - startTimeForUser) }
|
||||||
};
|
};
|
||||||
|
|
||||||
publisher.on('streamCreated', () => {
|
publisher.on('streamCreated', event => {
|
||||||
|
this.testFeedService.pushNewEvent({ user: 0, event });
|
||||||
publisherWrapper.state['connected'] = (Date.now() - startTimeForUser);
|
publisherWrapper.state['connected'] = (Date.now() - startTimeForUser);
|
||||||
});
|
});
|
||||||
publisher.on('streamPlaying', () => {
|
publisher.on('streamPlaying', event => {
|
||||||
|
this.testFeedService.pushNewEvent({ user: 0, event });
|
||||||
publisherWrapper.state['playing'] = (Date.now() - startTimeForUser);
|
publisherWrapper.state['playing'] = (Date.now() - startTimeForUser);
|
||||||
});
|
});
|
||||||
session.publish(publisher).catch(() => {
|
session.publish(publisher).catch(() => {
|
||||||
|
|
Loading…
Reference in New Issue