mirror of
https://github.com/livekit/livekit.git
synced 2026-10-28 16:32:38 +00:00
fix flaky TestAgentNamespaces (#5074)
causing a few race failures in CI
This commit is contained in:
1 parent
213df1a634
commit
85c678c7f0
1 file changed
+9
-7
+9
-7
@@ -140,6 +140,15 @@ func TestAgentNamespaces(t *testing.T) {
|
||||
ac1.Run(livekit.JobType_JT_ROOM, "namespace1")
|
||||
ac2.Run(livekit.JobType_JT_ROOM, "namespace2")
|
||||
|
||||
testutils.WithTimeout(t, func() string {
|
||||
if ac1.registered.Load() != 1 || ac2.registered.Load() != 1 {
|
||||
return "worker not registered"
|
||||
}
|
||||
return ""
|
||||
}, RegisterTimeout)
|
||||
|
||||
// a job goes only to the namespaces the server knows of when it
|
||||
// dispatches the job, so the room is created once both have registered
|
||||
_, err = roomClient.CreateRoom(contextWithToken(createRoomToken()), &livekit.CreateRoomRequest{
|
||||
Name: testRoom,
|
||||
Agents: []*livekit.RoomAgentDispatch{
|
||||
@@ -151,13 +160,6 @@ func TestAgentNamespaces(t *testing.T) {
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
testutils.WithTimeout(t, func() string {
|
||||
if ac1.registered.Load() != 1 || ac2.registered.Load() != 1 {
|
||||
return "worker not registered"
|
||||
}
|
||||
return ""
|
||||
}, RegisterTimeout)
|
||||
|
||||
c1 := createRTCClient("c1", defaultServerPort, testRTCServicePath, nil)
|
||||
waitUntilConnected(t, c1)
|
||||
|
||||
|
||||
Reference in new issue
Block a user