close rooms after delay instead of immediately after participant departure, to allow reconnects
This commit is contained in:
+15
-16
@@ -1,14 +1,10 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/go-redis/redis/v8"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/livekit-server/pkg/service"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
)
|
||||
|
||||
@@ -58,18 +54,21 @@ func TestMultiNodeRouting(t *testing.T) {
|
||||
c1.Stop()
|
||||
c2.Stop()
|
||||
|
||||
// ensure that room is closed
|
||||
rc := redisClient()
|
||||
ctx := context.Background()
|
||||
withTimeout(t, "room should be closed", func() bool {
|
||||
if rc.HGet(ctx, service.RoomsKey, testRoom).Err() == nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
|
||||
assert.Equal(t, redis.Nil, rc.HGet(ctx, routing.NodeRoomKey, testRoom).Err())
|
||||
assert.Equal(t, redis.Nil, rc.HGet(ctx, service.RoomIdMap, testRoom).Err())
|
||||
// TODO: delete room explicitly and ensure it's closed
|
||||
//
|
||||
//// ensure that room is closed
|
||||
//
|
||||
//rc := redisClient()
|
||||
//ctx := context.Background()
|
||||
//withTimeout(t, "room should be closed", func() bool {
|
||||
// if rc.HGet(ctx, service.RoomsKey, testRoom).Err() == nil {
|
||||
// return false
|
||||
// }
|
||||
// return true
|
||||
//})
|
||||
//
|
||||
//assert.Equal(t, redis.Nil, rc.HGet(ctx, routing.NodeRoomKey, testRoom).Err())
|
||||
//assert.Equal(t, redis.Nil, rc.HGet(ctx, service.RoomIdMap, testRoom).Err())
|
||||
}
|
||||
|
||||
func TestConnectWithoutCreation(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user