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) {
|
||||
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 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);
|
||||
|
||||
if (kms.getKurentoSessions().isEmpty()) {
|
||||
|
|
|
@ -402,6 +402,36 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest {
|
|||
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
|
||||
@DisplayName("Cross-Browser test")
|
||||
void crossBrowserTest() throws Exception {
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
"@angular/router": "14.2.12",
|
||||
"colormap": "2.3.2",
|
||||
"core-js": "3.26.1",
|
||||
"json-stringify-safe": "^5.0.1",
|
||||
"json-stringify-safe": "5.0.1",
|
||||
"openvidu-browser": "2.24.0",
|
||||
"openvidu-node-client": "2.24.0",
|
||||
"rxjs": "7.5.7",
|
||||
"tslib": "^2.4.1",
|
||||
"tslib": "2.4.1",
|
||||
"zone.js": "0.12.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -40,8 +40,8 @@
|
|||
"@types/node": "12.12.14",
|
||||
"codelyzer": "6.0.2",
|
||||
"ts-node": "8.5.4",
|
||||
"tslint": "~6.1.3",
|
||||
"typescript": "4.6.4"
|
||||
"tslint": "6.1.3",
|
||||
"typescript": "4.8.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@adobe/css-tools": {
|
||||
|
@ -10987,9 +10987,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "4.6.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz",
|
||||
"integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==",
|
||||
"version": "4.8.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
|
||||
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
|
@ -19557,9 +19557,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.6.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz",
|
||||
"integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==",
|
||||
"version": "4.8.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
|
||||
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
|
||||
"dev": true
|
||||
},
|
||||
"unicode-canonical-property-names-ecmascript": {
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
"@angular/router": "14.2.12",
|
||||
"colormap": "2.3.2",
|
||||
"core-js": "3.26.1",
|
||||
"json-stringify-safe": "^5.0.1",
|
||||
"json-stringify-safe": "5.0.1",
|
||||
"openvidu-browser": "2.24.0",
|
||||
"openvidu-node-client": "2.24.0",
|
||||
"rxjs": "7.5.7",
|
||||
"tslib": "^2.4.1",
|
||||
"tslib": "2.4.1",
|
||||
"zone.js": "0.12.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -27,12 +27,12 @@
|
|||
"@angular/language-service": "14.2.12",
|
||||
"@types/jasmine": "4.3.0",
|
||||
"@types/jasminewd2": "2.0.10",
|
||||
"@types/json-stringify-safe": "^5.0.0",
|
||||
"@types/json-stringify-safe": "5.0.0",
|
||||
"@types/node": "12.12.14",
|
||||
"codelyzer": "6.0.2",
|
||||
"ts-node": "8.5.4",
|
||||
"tslint": "~6.1.3",
|
||||
"typescript": "4.6.4"
|
||||
"tslint": "6.1.3",
|
||||
"typescript": "4.8.4"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"name": "openvidu-testapp",
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
<mat-toolbar class="mat-elevation-z5" color="primary">
|
||||
<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 mat-button routerLink="/test-sessions"><span>SESSIONS</span></a>
|
||||
<a mat-button routerLink="/test-scenarios"><span>SCENARIOS</span></a>
|
||||
<a mat-button routerLink="/test-apirest"><span>API REST</span></a>
|
||||
<a mat-button id="toolbar-sessions" routerLink="/test-sessions"><span>SESSIONS</span></a>
|
||||
<a mat-button id="toolbar-scenarios" routerLink="/test-scenarios"><span>SCENARIOS</span></a>
|
||||
<a mat-button id="toolbar-apirest" routerLink="/test-apirest"><span>API REST</span></a>
|
||||
</div>
|
||||
</mat-toolbar>
|
||||
<main>
|
||||
|
|
|
@ -11,6 +11,7 @@ import { StreamManagerWrapper } from '../users-table/table-video.component';
|
|||
import { MatDialog } from '@angular/material/dialog';
|
||||
import {
|
||||
ConnectionEvent, OpenVidu, PublisherProperties, Session,
|
||||
SessionDisconnectedEvent,
|
||||
StreamEvent,
|
||||
StreamManagerEvent
|
||||
} from 'openvidu-browser';
|
||||
|
@ -183,6 +184,10 @@ export class TestScenariosComponent implements OnInit, OnDestroy {
|
|||
|
||||
const OV = new OpenVidu();
|
||||
|
||||
OV.setAdvancedConfiguration({
|
||||
noStreamPlayingEventExceptionTimeout: 50000
|
||||
});
|
||||
|
||||
if (this.turnConf === 'freeice') {
|
||||
OV.setAdvancedConfiguration({ iceServers: 'freeice' });
|
||||
} 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) {
|
||||
session.on('streamCreated', (event: StreamEvent) => {
|
||||
|
||||
this.testFeedService.pushNewEvent({ user: 0, event });
|
||||
|
||||
const subscriber = session.subscribe(event.stream, undefined, (error) => {
|
||||
const subAux = this.subscribers
|
||||
.find(s => s.connectionId === session.connection.connectionId).subs
|
||||
|
@ -233,6 +245,9 @@ export class TestScenariosComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
subscriber.on('streamPlaying', (e: StreamManagerEvent) => {
|
||||
|
||||
this.testFeedService.pushNewEvent({ user: 0, event: e });
|
||||
|
||||
this.subscribers
|
||||
.find(s => s.connectionId === session.connection.connectionId).subs
|
||||
.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) }
|
||||
};
|
||||
|
||||
publisher.on('streamCreated', () => {
|
||||
publisher.on('streamCreated', event => {
|
||||
this.testFeedService.pushNewEvent({ user: 0, event });
|
||||
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);
|
||||
});
|
||||
session.publish(publisher).catch(() => {
|
||||
|
|
Loading…
Reference in New Issue