mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2026-03-14 14:35:44 +01:00
Relax order when checking for join/leave in RunTestClientTakeoverRoomSession.
This commit is contained in:
parent
8c12403c4f
commit
315b2583e1
1 changed files with 16 additions and 4 deletions
20
hub_test.go
20
hub_test.go
|
|
@ -3588,10 +3588,22 @@ func RunTestClientTakeoverRoomSession(t *testing.T) {
|
|||
client2.RunUntilErrorIs(ctx2, ErrNoMessageReceived, context.DeadlineExceeded)
|
||||
|
||||
// The permanently connected client will receive a "left" event from the
|
||||
// overridden session and a "joined" for the new session. In that order as
|
||||
// both were on the same server.
|
||||
client3.RunUntilLeft(ctx, hello1.Hello)
|
||||
client3.RunUntilJoined(ctx, hello2.Hello)
|
||||
// overridden session and a "joined" for the new session.
|
||||
msg1 := MustSucceed1(t, client3.RunUntilMessage, ctx)
|
||||
msg2 := MustSucceed1(t, client3.RunUntilMessage, ctx)
|
||||
if msg1.Type == "event" && msg2.Type == "event" && msg1.Event.Type == "join" {
|
||||
t.Logf("Switching messages order")
|
||||
msg1, msg2 = msg2, msg1
|
||||
}
|
||||
|
||||
client3.checkMessageRoomLeave(msg1, hello1.Hello)
|
||||
if checkMessageType(t, msg2, "event") &&
|
||||
assert.Equal("room", msg2.Event.Target, "invalid target in %+v", msg2) &&
|
||||
assert.Equal("join", msg2.Event.Type, "invalid event type in %+v", msg2) &&
|
||||
assert.Len(msg2.Event.Join, 1, "invalid number of join event entries: %+v", msg2.Event) {
|
||||
assert.Equal(hello2.Hello.SessionId, msg2.Event.Join[0].SessionId)
|
||||
assert.Equal(hello2.Hello.UserId, msg2.Event.Join[0].UserId)
|
||||
}
|
||||
}
|
||||
|
||||
func TestClientSendOfferPermissions(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue