| 132 | } |
| 133 | |
| 134 | func waitUntilConnected(t *testing.T, clients ...*testclient.RTCClient) { |
| 135 | logger.Infow("waiting for clients to become connected") |
| 136 | wg := sync.WaitGroup{} |
| 137 | for i := range clients { |
| 138 | c := clients[i] |
| 139 | wg.Go(func() { |
| 140 | err := c.WaitUntilConnected(5 * time.Second) |
| 141 | if err != nil { |
| 142 | t.Error(err) |
| 143 | } |
| 144 | }) |
| 145 | } |
| 146 | wg.Wait() |
| 147 | if t.Failed() { |
| 148 | t.FailNow() |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | func ensureNotConnected(t *testing.T, clients ...*testclient.RTCClient) { |
| 153 | logger.Infow("checking if clients connect") |