diff --git a/pkg/server/matchmaker/matchmaker_test.go b/pkg/server/matchmaker/matchmaker_test.go index 1e4d599..9ab88f7 100644 --- a/pkg/server/matchmaker/matchmaker_test.go +++ b/pkg/server/matchmaker/matchmaker_test.go @@ -149,7 +149,8 @@ func (s *MatchMakerTestSuite) Test_singleAgentAndClient() { waitForAgentFunc := s.registerAgent(publicId, agent) go waitForAgentFunc() - client, clientId := s.connectClient(publicId) + client, clientId, err := s.connectClient(publicId) + s.Nil(err) s.checkState(1, 1) @@ -167,10 +168,10 @@ func (s *MatchMakerTestSuite) Test_singleAgentAndClient() { s.checkState(1, 0) } -func (s *MatchMakerTestSuite) connectClient(publicId models.RendezVousId) (*TestClient, models.ClientId) { +func (s *MatchMakerTestSuite) connectClient(publicId models.RendezVousId) (*TestClient, models.ClientId, error) { client := NewTestClient(s.ctx) var clientId models.ClientId - testsupport.RunAndWait( + res := testsupport.RunAndWait( &s.Suite, func() any { //server @@ -181,13 +182,18 @@ func (s *MatchMakerTestSuite) connectClient(publicId models.RendezVousId) (*Test log.Println("test: synchronizing streams.") go synchronizer() } - return nil + return err }, func() any { // client, nothing to do with wsproxy mode off. return nil }) - return client, clientId + + var err error = nil + if res[0] != nil { + err = res[0].(error) + } + return client, clientId, err } func (s *MatchMakerTestSuite) checkState(nAgents int, nClients int) {