| 179 | } |
| 180 | |
| 181 | func (p *Peer) AssertNeverHasDERPs(ctx context.Context, other uuid.UUID, expected ...int32) { |
| 182 | p.t.Helper() |
| 183 | for { |
| 184 | select { |
| 185 | case <-ctx.Done(): |
| 186 | return |
| 187 | case resp, ok := <-p.resps: |
| 188 | if !ok { |
| 189 | p.t.Errorf("response channel closed") |
| 190 | } |
| 191 | if !assert.NoError(p.t, p.handleResp(resp)) { |
| 192 | return |
| 193 | } |
| 194 | derp, ok := p.peers[other] |
| 195 | if !ok { |
| 196 | continue |
| 197 | } |
| 198 | if !assert.NotContains(p.t, expected, derp) { |
| 199 | return |
| 200 | } |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | func (p *Peer) AssertEventuallyDisconnected(other uuid.UUID) { |
| 206 | p.t.Helper() |