fixed multi-node so signal node can start sessions

This commit is contained in:
David Zhao
2021-01-26 23:52:55 -08:00
parent 940b96168d
commit 61db4f5b66
9 changed files with 48 additions and 42 deletions
+1 -1
View File
@@ -115,10 +115,10 @@ func waitUntilConnected(t *testing.T, clients ...*client.RTCClient) {
c := clients[i]
wg.Add(1)
go func() {
defer wg.Done()
if !assert.NoError(t, c.WaitUntilConnected()) {
t.Fatal("one or more clients could not connect")
}
wg.Done()
}()
}
wg.Wait()
+4 -2
View File
@@ -31,13 +31,15 @@ func TestMultiNodeRouting(t *testing.T) {
// one node connecting to node 1, and another connecting to node 2
c1 := createRTCClient("c1", defaultServerPort)
c2 := createRTCClient("c2", defaultServerPort)
c2 := createRTCClient("c2", secondServerPort)
waitUntilConnected(t, c1, c2)
// c1 publishing, and c2 receiving
t1, err := c1.AddStaticTrack("audio/opus", "audio", "webcam")
assert.NoError(t, err)
defer t1.Stop()
if t1 != nil {
defer t1.Stop()
}
withTimeout(t, "c2 should receive one track", func() bool {
if len(c2.SubscribedTracks()) == 0 {
+10
View File
@@ -0,0 +1,10 @@
package test
import (
"testing"
)
// a scenario with lots of clients connecting, publishing, and leaving at random periods
func scenarioRandom(t *testing.T) {
}