mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-05-02 22:03:09 +02:00
Don't call "Fatal" from inside a goroutine.
This commit is contained in:
parent
67c5bebdcb
commit
efc232fb9c
|
@ -1068,11 +1068,13 @@ func TestBackendServer_ParticipantsUpdateTimeout(t *testing.T) {
|
|||
|
||||
data, err := json.Marshal(msg)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
res, err := performBackendRequest(server.URL+"/api/v1/room/"+roomId, data)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
defer res.Body.Close()
|
||||
body, err := ioutil.ReadAll(res.Body)
|
||||
|
@ -1119,11 +1121,13 @@ func TestBackendServer_ParticipantsUpdateTimeout(t *testing.T) {
|
|||
|
||||
data, err := json.Marshal(msg)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
res, err := performBackendRequest(server.URL+"/api/v1/room/"+roomId, data)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
defer res.Body.Close()
|
||||
body, err := ioutil.ReadAll(res.Body)
|
||||
|
@ -1136,6 +1140,9 @@ func TestBackendServer_ParticipantsUpdateTimeout(t *testing.T) {
|
|||
}()
|
||||
|
||||
wg.Wait()
|
||||
if t.Failed() {
|
||||
return
|
||||
}
|
||||
|
||||
msg1_a, err := client1.RunUntilMessage(ctx)
|
||||
if err != nil {
|
||||
|
|
|
@ -88,7 +88,8 @@ func TestLoopbackNatsClient_Subscribe(t *testing.T) {
|
|||
if total == max {
|
||||
err := sub.Unsubscribe()
|
||||
if err != nil {
|
||||
t.Fatal("Unsubscribe failed with err:", err)
|
||||
t.Errorf("Unsubscribe failed with err: %s", err)
|
||||
return
|
||||
}
|
||||
ch <- true
|
||||
}
|
||||
|
@ -135,10 +136,12 @@ func TestLoopbackNatsClient_Request(t *testing.T) {
|
|||
go func() {
|
||||
msg := <-dest
|
||||
if err := client.Publish(msg.Reply, []byte("world")); err != nil {
|
||||
t.Fatal(err)
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
if err := sub.Unsubscribe(); err != nil {
|
||||
t.Fatal("Unsubscribe failed with err:", err)
|
||||
t.Error("Unsubscribe failed with err:", err)
|
||||
return
|
||||
}
|
||||
}()
|
||||
reply, err := client.Request("foo", []byte("hello"), 1*time.Second)
|
||||
|
@ -182,10 +185,12 @@ func TestLoopbackNatsClient_RequestTimeout(t *testing.T) {
|
|||
msg := <-dest
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
if err := client.Publish(msg.Reply, []byte("world")); err != nil {
|
||||
t.Fatal(err)
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
if err := sub.Unsubscribe(); err != nil {
|
||||
t.Fatal("Unsubscribe failed with err:", err)
|
||||
t.Error("Unsubscribe failed with err:", err)
|
||||
return
|
||||
}
|
||||
}()
|
||||
reply, err := client.Request("foo", []byte("hello"), 100*time.Millisecond)
|
||||
|
|
|
@ -233,7 +233,8 @@ func NewTestClient(t *testing.T, server *httptest.Server, hub *Hub) *TestClient
|
|||
readErrorChan <- err
|
||||
return
|
||||
} else if messageType != websocket.TextMessage {
|
||||
t.Fatalf("Expect text message, got %d", messageType)
|
||||
t.Errorf("Expect text message, got %d", messageType)
|
||||
return
|
||||
}
|
||||
|
||||
messageChan <- data
|
||||
|
|
Loading…
Reference in a new issue