mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-05-10 01:26:32 +02:00
Reuse existing "WaitForUsersJoined" for test.
This commit is contained in:
parent
a3718a4664
commit
b165c44080
|
@ -946,53 +946,7 @@ func TestBackendServer_ParticipantsUpdateTimeout(t *testing.T) {
|
||||||
defer hubRoom.Close()
|
defer hubRoom.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// We will receive "joined" events for all clients. The ordering is not
|
WaitForUsersJoined(ctx, t, client1, hello1, client2, hello2)
|
||||||
// defined as messages are processed and sent by asynchronous NATS handlers.
|
|
||||||
msg1_1, err := client1.RunUntilMessage(ctx)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
msg1_2, err := client1.RunUntilMessage(ctx)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
msg2_1, err := client2.RunUntilMessage(ctx)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
msg2_2, err := client2.RunUntilMessage(ctx)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := client1.checkMessageJoined(msg1_1, hello1.Hello); err != nil {
|
|
||||||
// Ordering is "joined" from client 2, then from client 1
|
|
||||||
if err := client1.checkMessageJoined(msg1_1, hello2.Hello); err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
if err := client1.checkMessageJoined(msg1_2, hello1.Hello); err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Ordering is "joined" from client 1, then from client 2
|
|
||||||
if err := client1.checkMessageJoined(msg1_2, hello2.Hello); err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err := client2.checkMessageJoined(msg2_1, hello1.Hello); err != nil {
|
|
||||||
// Ordering is "joined" from client 2, then from client 1
|
|
||||||
if err := client2.checkMessageJoined(msg2_1, hello2.Hello); err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
if err := client2.checkMessageJoined(msg2_2, hello1.Hello); err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Ordering is "joined" from client 1, then from client 2
|
|
||||||
if err := client2.checkMessageJoined(msg2_2, hello2.Hello); err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue