mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-06-05 07:22:15 +02:00
Prevent endless loop in case of context timeout / cancellation.
This commit is contained in:
parent
05b9f4d6c9
commit
86ee075a3b
|
@ -24,6 +24,7 @@ package signaling
|
|||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
@ -219,6 +220,9 @@ func TestVirtualSession(t *testing.T) {
|
|||
messages, err := client2.GetPendingMessages(ctx)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
if errors.Is(err, context.DeadlineExceeded) || errors.Is(err, context.Canceled) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
receivedMessages = append(receivedMessages, messages...)
|
||||
|
|
Loading…
Reference in a new issue