Browse Source

Return error if unknown hello session was received while waiting for joined events.

pull/101/head
Joachim Bauch 2 weeks ago
parent
commit
5d87df4b8e
No known key found for this signature in database GPG Key ID: 77C1D22D53E15F02
  1. 6
      testclient_test.go

6
testclient_test.go

@ -535,11 +535,17 @@ func (c *TestClient) RunUntilJoined(ctx context.Context, hello ...*HelloServerMe
if err := c.checkSingleMessageJoined(message); err != nil {
return err
}
found := false
for idx, h := range hello {
if err := c.checkMessageJoined(message, h); err == nil {
hello = append(hello[:idx], hello[idx+1:]...)
found = true
break
}
}
if !found {
return fmt.Errorf("expected one of the passed hello sessions, got %+v", message.Event.Join[0])
}
}
}
return nil

Loading…
Cancel
Save