No need to manually close rooms in testing, will be done by hub on client disconnects.

This commit is contained in:
Joachim Bauch
2021-04-23 15:26:05 +02:00
parent 8052df4ef5
commit 0c53f10fd7
3 changed files with 1 additions and 63 deletions
+1 -34
View File
@@ -1125,9 +1125,6 @@ func TestClientHelloResumeAndJoin(t *testing.T) {
} else if room.Room.RoomId != roomId {
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
}
if hubRoom := hub.getRoom(roomId); hubRoom != nil {
defer hubRoom.Close()
}
}
func TestClientHelloClient(t *testing.T) {
@@ -1480,10 +1477,6 @@ func TestClientMessageToRoom(t *testing.T) {
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
}
if hubRoom := hub.getRoom(roomId); hubRoom != nil {
defer hubRoom.Close()
}
WaitForUsersJoined(ctx, t, client1, hello1, client2, hello2)
recipient := MessageClientMessageRecipient{
@@ -1536,10 +1529,6 @@ func TestJoinRoom(t *testing.T) {
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
}
if hubRoom := hub.getRoom(roomId); hubRoom != nil {
defer hubRoom.Close()
}
// We will receive a "joined" event.
if err := client.RunUntilJoined(ctx, hello.Hello); err != nil {
t.Error(err)
@@ -1633,10 +1622,6 @@ func TestJoinRoomChange(t *testing.T) {
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
}
if hubRoom := hub.getRoom(roomId); hubRoom != nil {
defer hubRoom.Close()
}
// We will receive a "joined" event.
if err := client.RunUntilJoined(ctx, hello.Hello); err != nil {
t.Error(err)
@@ -1650,10 +1635,6 @@ func TestJoinRoomChange(t *testing.T) {
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
}
if hubRoom := hub.getRoom(roomId); hubRoom != nil {
defer hubRoom.Close()
}
// We will receive a "joined" event.
if err := client.RunUntilJoined(ctx, hello.Hello); err != nil {
t.Error(err)
@@ -1706,10 +1687,6 @@ func TestJoinMultiple(t *testing.T) {
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
}
if hubRoom := hub.getRoom(roomId); hubRoom != nil {
defer hubRoom.Close()
}
// We will receive a "joined" event.
if err := client1.RunUntilJoined(ctx, hello1.Hello); err != nil {
t.Error(err)
@@ -1928,10 +1905,6 @@ func TestRoomParticipantsListUpdateWhileDisconnected(t *testing.T) {
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
}
if hubRoom := hub.getRoom(roomId); hubRoom != nil {
defer hubRoom.Close()
}
WaitForUsersJoined(ctx, t, client1, hello1, client2, hello2)
// Simulate request from the backend that somebody joined the call.
@@ -2045,9 +2018,7 @@ func TestClientTakeoverRoomSession(t *testing.T) {
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
}
if hubRoom := hub.getRoom(roomId); hubRoom != nil {
defer hubRoom.Close()
} else {
if hubRoom := hub.getRoom(roomId); hubRoom == nil {
t.Fatalf("Room %s does not exist", roomId)
}
@@ -2207,10 +2178,6 @@ func TestClientSendOfferPermissions(t *testing.T) {
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
}
if hubRoom := hub.getRoom(roomId); hubRoom != nil {
defer hubRoom.Close()
}
WaitForUsersJoined(ctx, t, client1, hello1, client2, hello2)
session1 := hub.GetSessionByPublicId(hello1.Hello.SessionId).(*ClientSession)