Skip to content

Commit 70d3604

Browse files
committed
make time 5 seconds
1 parent 3ed10c5 commit 70d3604

File tree

2 files changed

+24
-29
lines changed

2 files changed

+24
-29
lines changed

internal/e2e-js/tests/callfabric/callStartTime.spec.ts

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@ import { uuid } from '@signalwire/core'
22
import { test, expect } from '../../fixtures'
33
import { SERVER_URL, createCFClient } from '../../utils'
44
import { 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

916
test.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
})

internal/e2e-js/tests/roomSessionStartTime.spec.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@ import type { Video } from '@signalwire/js'
22
import { test, expect } from '../fixtures'
33
import { SERVER_URL, createTestRoomSession, randomizeRoomName } from '../utils'
44

5-
const MAX_CALL_SETUP_TIME_MS = 4000
5+
export const MAX_CALL_SETUP_TIME_MS = 5000
6+
7+
export const logCallStartTime = (ms: number) => {
8+
if (ms < MAX_CALL_SETUP_TIME_MS) {
9+
console.log(`\x1b[1;32m✅ call.start(): ${ms.toFixed(0)} ms\x1b[0m`)
10+
} else {
11+
console.log(`\x1b[1;31m❌ call.start(): ${ms.toFixed(0)} ms\x1b[0m`)
12+
}
13+
}
614

715
test.describe('RoomSession Start Time', () => {
8-
test('should join a room room within 4 seconds', async ({
16+
test('should join a room room within 5 seconds', async ({
917
createCustomPage,
1018
}) => {
1119
const page = await createCustomPage({ name: 'raise-lower' })
@@ -40,10 +48,7 @@ test.describe('RoomSession Start Time', () => {
4048
})
4149
})
4250

43-
console.log('::group::CallFabric perf')
44-
console.log(`[PERF] call.start(ms)= ${ms.toFixed(0)}`)
45-
console.log(`::notice title=Call setup latency::${Math.round(ms)} ms`)
46-
console.log('::endgroup::')
51+
logCallStartTime(ms)
4752

4853
expect(ms).toBeLessThan(MAX_CALL_SETUP_TIME_MS)
4954
})

0 commit comments

Comments
 (0)