Skip to content

Commit 3ed10c5

Browse files
committed
make time 4 seconds
1 parent 84c247f commit 3ed10c5

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

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

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ 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'
56

6-
const MAX_CALL_SETUP_TIME_MS = 5000
7+
const MAX_CALL_SETUP_TIME_MS = 4000
78

89
test.describe('CallFabric Start Time', () => {
9-
test('should join a video room within 5 seconds', async ({
10+
test('should join a video room within 4 seconds', async ({
1011
createCustomPage,
1112
resource,
1213
}) => {
@@ -41,15 +42,26 @@ test.describe('CallFabric Start Time', () => {
4142
}
4243
)
4344

44-
console.log('::group::CallFabric perf')
45-
console.log(`[PERF] call.start(ms)= ${ms.toFixed(0)}`)
46-
console.log(`::notice title=Call setup latency::${Math.round(ms)} ms`)
47-
console.log('::endgroup::')
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+
}
4860

4961
expect(ms).toBeLessThan(MAX_CALL_SETUP_TIME_MS)
5062
})
5163

52-
test('should join an audio-only room within 5 seconds', async ({
64+
test('should join an audio-only room within 4 seconds', async ({
5365
createCustomPage,
5466
resource,
5567
}) => {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ 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 = 5000
5+
const MAX_CALL_SETUP_TIME_MS = 4000
66

77
test.describe('RoomSession Start Time', () => {
8-
test('should join a room room within 5 seconds', async ({
8+
test('should join a room room within 4 seconds', async ({
99
createCustomPage,
1010
}) => {
1111
const page = await createCustomPage({ name: 'raise-lower' })

0 commit comments

Comments
 (0)