mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-05-02 22:03:09 +02:00
Attempt to fix flaky tests.
This commit is contained in:
parent
21f3f506d1
commit
6e54d8f4f4
|
@ -1933,6 +1933,9 @@ func TestClientMessageToSessionIdWhileDisconnected(t *testing.T) {
|
|||
client1.SendMessage(recipient2, data1) // nolint
|
||||
client1.SendMessage(recipient2, data1) // nolint
|
||||
|
||||
// Simulate some time until client resumes the session.
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
|
||||
client2 = NewTestClient(t, server, hub)
|
||||
defer client2.CloseWithBye()
|
||||
if err := client2.SendHelloResume(hello2.Hello.ResumeId); err != nil {
|
||||
|
|
|
@ -25,6 +25,7 @@ import (
|
|||
"encoding/json"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/nats-io/nats.go"
|
||||
)
|
||||
|
@ -95,6 +96,9 @@ func (s *loopbackNatsSubscription) run() {
|
|||
msg := s.incoming[0]
|
||||
s.incoming = s.incoming[1:]
|
||||
s.cond.L.Unlock()
|
||||
// A "real" NATS server would take some time to process the request,
|
||||
// simulate this by sleeping a tiny bit.
|
||||
time.Sleep(time.Millisecond)
|
||||
s.ch <- msg
|
||||
s.cond.L.Lock()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue