This commit is contained in:
Jae Kwon
2018-04-05 08:17:10 -07:00
parent 799beebd36
commit e4492afbad
24 changed files with 97 additions and 120 deletions

View File

@ -65,7 +65,7 @@ func WaitForOneEvent(c EventsClient, evtTyp string, timeout time.Duration) (type
query := types.QueryForEvent(evtTyp)
err := c.Subscribe(ctx, subscriber, query, evts)
if err != nil {
return types.TMEventData{}, errors.Wrap(err, "failed to subscribe")
return nil, errors.Wrap(err, "failed to subscribe")
}
// make sure to unregister after the test is over
@ -75,6 +75,6 @@ func WaitForOneEvent(c EventsClient, evtTyp string, timeout time.Duration) (type
case evt := <-evts:
return evt.(types.TMEventData), nil
case <-ctx.Done():
return types.TMEventData{}, errors.New("timed out waiting for event")
return nil, errors.New("timed out waiting for event")
}
}