MCPcopy Index your code
hub / github.com/livekit/livekit / TestMultinodeReconnectAfterNodeShutdown

Function TestMultinodeReconnectAfterNodeShutdown

test/multinode_test.go:125–159  ·  view source on GitHub ↗

reconnecting to the same room, after one of the servers has gone away

(t *testing.T)

Source from the content-addressed store, hash-verified

123
124// reconnecting to the same room, after one of the servers has gone away
125func TestMultinodeReconnectAfterNodeShutdown(t *testing.T) {
126 if testing.Short() {
127 t.SkipNow()
128 return
129 }
130
131 for _, testRTCServicePath := range testRTCServicePaths {
132 t.Run(fmt.Sprintf("testRTCServicePath=%s", testRTCServicePath.String()), func(t *testing.T) {
133 _, s2, finish := setupMultiNodeTest("TestMultinodeReconnectAfterNodeShutdown")
134 defer finish()
135
136 // creating room on node 1
137 _, err := roomClient.CreateRoom(contextWithToken(createRoomToken()), &livekit.CreateRoomRequest{
138 Name: testRoom,
139 NodeId: s2.Node().Id,
140 })
141 require.NoError(t, err)
142
143 // one node connecting to node 1, and another connecting to node 2
144 c1 := createRTCClient("c1", defaultServerPort, testRTCServicePath, nil)
145 c2 := createRTCClient("c2", secondServerPort, testRTCServicePath, nil)
146
147 waitUntilConnected(t, c1, c2)
148 stopClients(c1, c2)
149
150 // stop s2, and connect to room again
151 s2.Stop(true)
152
153 time.Sleep(syncDelay)
154
155 c3 := createRTCClient("c3", defaultServerPort, testRTCServicePath, nil)
156 waitUntilConnected(t, c3)
157 })
158 }
159}
160
161func TestMultinodeDataPublishing(t *testing.T) {
162 if testing.Short() {

Callers

nothing calls this directly

Calls 11

setupMultiNodeTestFunction · 0.85
contextWithTokenFunction · 0.85
createRoomTokenFunction · 0.85
createRTCClientFunction · 0.85
waitUntilConnectedFunction · 0.85
stopClientsFunction · 0.85
NodeMethod · 0.80
CreateRoomMethod · 0.65
StopMethod · 0.65
RunMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected