add roommanager service (#2931)
* add roommanager service * cleanup * deps * timeout * cleanup * cleanup * config * cleanup
This commit is contained in:
@@ -39,13 +39,15 @@ func TestCreateRoom(t *testing.T) {
|
||||
|
||||
ra, conf := newTestRoomAllocator(t, conf, node)
|
||||
|
||||
room, _, err := ra.CreateRoom(context.Background(), &livekit.CreateRoomRequest{Name: "myroom"})
|
||||
room, _, _, err := ra.CreateRoom(context.Background(), &livekit.CreateRoomRequest{Name: "myroom"})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, conf.Room.EmptyTimeout, room.EmptyTimeout)
|
||||
require.Equal(t, conf.Room.DepartureTimeout, room.DepartureTimeout)
|
||||
require.NotEmpty(t, room.EnabledCodecs)
|
||||
})
|
||||
}
|
||||
|
||||
func SelectRoomNode(t *testing.T) {
|
||||
t.Run("reject new participants when track limit has been reached", func(t *testing.T) {
|
||||
conf, err := config.NewConfig("", true, nil, nil)
|
||||
require.NoError(t, err)
|
||||
@@ -58,7 +60,7 @@ func TestCreateRoom(t *testing.T) {
|
||||
|
||||
ra, _ := newTestRoomAllocator(t, conf, node)
|
||||
|
||||
_, _, err = ra.CreateRoom(context.Background(), &livekit.CreateRoomRequest{Name: "low-limit-room"})
|
||||
err = ra.SelectRoomNode(context.Background(), "low-limit-room", "")
|
||||
require.ErrorIs(t, err, routing.ErrNodeLimitReached)
|
||||
})
|
||||
|
||||
@@ -74,7 +76,7 @@ func TestCreateRoom(t *testing.T) {
|
||||
|
||||
ra, _ := newTestRoomAllocator(t, conf, node)
|
||||
|
||||
_, _, err = ra.CreateRoom(context.Background(), &livekit.CreateRoomRequest{Name: "low-limit-room"})
|
||||
err = ra.SelectRoomNode(context.Background(), "low-limit-room", "")
|
||||
require.ErrorIs(t, err, routing.ErrNodeLimitReached)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user