@@ -2,12 +2,19 @@ import { uuid } from '@signalwire/core'
22import { test , expect } from '../../fixtures'
33import { SERVER_URL , createCFClient } from '../../utils'
44import { SignalWireContract } from '@signalwire/js'
5- import { appendFileSync } from 'fs'
65
7- const MAX_CALL_SETUP_TIME_MS = 4000
6+ export const MAX_CALL_SETUP_TIME_MS = 5000
7+
8+ export const logCallStartTime = ( ms : number ) => {
9+ if ( ms < MAX_CALL_SETUP_TIME_MS ) {
10+ console . log ( `\x1b[1;32m✅ call.start(): ${ ms . toFixed ( 0 ) } ms\x1b[0m` )
11+ } else {
12+ console . log ( `\x1b[1;31m❌ call.start(): ${ ms . toFixed ( 0 ) } ms\x1b[0m` )
13+ }
14+ }
815
916test . describe ( 'CallFabric Start Time' , ( ) => {
10- test ( 'should join a video room within 4 seconds' , async ( {
17+ test ( 'should join a video room within 5 seconds' , async ( {
1118 createCustomPage,
1219 resource,
1320 } ) => {
@@ -42,26 +49,12 @@ test.describe('CallFabric Start Time', () => {
4249 }
4350 )
4451
45- if ( ms < MAX_CALL_SETUP_TIME_MS ) {
46- console . log ( `\x1b[1;32m✅ call.start(): ${ ms . toFixed ( 0 ) } ms\x1b[0m` )
47- } else {
48- console . log ( `\x1b[1;31m❌ call.start(): ${ ms . toFixed ( 0 ) } ms\x1b[0m` )
49- }
50-
51- if ( process . env . GITHUB_STEP_SUMMARY ) {
52- const summary = [
53- '### CallFabric Performance' ,
54- '' ,
55- `- Room: \`${ roomName } \`` ,
56- `- \`call.start()\`: **${ ms . toFixed ( 0 ) } ms**` ,
57- ] . join ( '\n' )
58- appendFileSync ( process . env . GITHUB_STEP_SUMMARY , `\n${ summary } \n` )
59- }
52+ logCallStartTime ( ms )
6053
6154 expect ( ms ) . toBeLessThan ( MAX_CALL_SETUP_TIME_MS )
6255 } )
6356
64- test ( 'should join an audio-only room within 4 seconds' , async ( {
57+ test ( 'should join an audio-only room within 5 seconds' , async ( {
6558 createCustomPage,
6659 resource,
6760 } ) => {
@@ -95,10 +88,7 @@ test.describe('CallFabric Start Time', () => {
9588 }
9689 )
9790
98- console . log ( '::group::CallFabric perf' )
99- console . log ( `[PERF] call.start(ms)= ${ ms . toFixed ( 0 ) } ` )
100- console . log ( `::notice title=Call setup latency::${ Math . round ( ms ) } ms` )
101- console . log ( '::endgroup::' )
91+ logCallStartTime ( ms )
10292
10393 expect ( ms ) . toBeLessThan ( MAX_CALL_SETUP_TIME_MS )
10494 } )
0 commit comments