mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-06-18 05:35:01 +02:00
Merge pull request #31 from strukturag/ci-flaky-fixes
Fix flaky CI test runs
This commit is contained in:
commit
2d21c98928
4
Makefile
4
Makefile
|
@ -31,6 +31,10 @@ ifneq ($(TEST),)
|
||||||
TESTARGS := $(TESTARGS) -run $(TEST)
|
TESTARGS := $(TESTARGS) -run $(TEST)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(COUNT),)
|
||||||
|
TESTARGS := $(TESTARGS) -count $(COUNT)
|
||||||
|
endif
|
||||||
|
|
||||||
hook:
|
hook:
|
||||||
[ ! -d "$(CURDIR)/.git/hooks" ] || ln -sf "$(CURDIR)/scripts/pre-commit.hook" "$(CURDIR)/.git/hooks/pre-commit"
|
[ ! -d "$(CURDIR)/.git/hooks" ] || ln -sf "$(CURDIR)/scripts/pre-commit.hook" "$(CURDIR)/.git/hooks/pre-commit"
|
||||||
|
|
||||||
|
|
|
@ -936,6 +936,10 @@ func TestBackendServer_ParticipantsUpdateTimeout(t *testing.T) {
|
||||||
} else if room.Room.RoomId != roomId {
|
} else if room.Room.RoomId != roomId {
|
||||||
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
|
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Give message processing some time.
|
||||||
|
time.Sleep(10 * time.Millisecond)
|
||||||
|
|
||||||
if room, err := client2.JoinRoom(ctx, roomId); err != nil {
|
if room, err := client2.JoinRoom(ctx, roomId); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
} else if room.Room.RoomId != roomId {
|
} else if room.Room.RoomId != roomId {
|
||||||
|
@ -946,53 +950,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
|
||||||
|
|
||||||
|
|
|
@ -1221,6 +1221,10 @@ func TestClientMessageToRoom(t *testing.T) {
|
||||||
} else if room.Room.RoomId != roomId {
|
} else if room.Room.RoomId != roomId {
|
||||||
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
|
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Give message processing some time.
|
||||||
|
time.Sleep(10 * time.Millisecond)
|
||||||
|
|
||||||
if room, err := client2.JoinRoom(ctx, roomId); err != nil {
|
if room, err := client2.JoinRoom(ctx, roomId); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
} else if room.Room.RoomId != roomId {
|
} else if room.Room.RoomId != roomId {
|
||||||
|
@ -1665,6 +1669,10 @@ func TestRoomParticipantsListUpdateWhileDisconnected(t *testing.T) {
|
||||||
} else if room.Room.RoomId != roomId {
|
} else if room.Room.RoomId != roomId {
|
||||||
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
|
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Give message processing some time.
|
||||||
|
time.Sleep(10 * time.Millisecond)
|
||||||
|
|
||||||
if room, err := client2.JoinRoom(ctx, roomId); err != nil {
|
if room, err := client2.JoinRoom(ctx, roomId); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
} else if room.Room.RoomId != roomId {
|
} else if room.Room.RoomId != roomId {
|
||||||
|
@ -1940,6 +1948,10 @@ func TestClientSendOfferPermissions(t *testing.T) {
|
||||||
} else if room.Room.RoomId != roomId {
|
} else if room.Room.RoomId != roomId {
|
||||||
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
|
t.Fatalf("Expected room %s, got %s", roomId, room.Room.RoomId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Give message processing some time.
|
||||||
|
time.Sleep(10 * time.Millisecond)
|
||||||
|
|
||||||
if room, err := client2.JoinRoom(ctx, roomId); err != nil {
|
if room, err := client2.JoinRoom(ctx, roomId); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
} else if room.Room.RoomId != roomId {
|
} else if room.Room.RoomId != roomId {
|
||||||
|
|
Loading…
Reference in a new issue