tests: remove t.Fatal from goroutines

This commit was moved from ipfs/interface-go-ipfs-core@5f17f8346b

This commit was moved from ipfs/boxo@ccb4a5c183
This commit is contained in:
Steven Allen 2019-03-26 18:35:13 +00:00
parent 6190be29b9
commit 1f87fa6168
2 changed files with 8 additions and 4 deletions

View File

@ -40,7 +40,9 @@ func (tp *provider) TestBasicPubSub(t *testing.T) {
for {
err := apis[1].PubSub().Publish(ctx, "testch", []byte("hello world"))
if err != nil {
t.Fatal(err)
t.Error(err)
cancel()
return
}
select {
case <-tick:

View File

@ -423,11 +423,13 @@ func (tp *provider) TestAdd(t *testing.T) {
for evt := range eventOut {
event, ok := evt.(*coreiface.AddEvent)
if !ok {
t.Fatal("unexpected event type")
t.Error("unexpected event type")
continue
}
if len(expected) < 1 {
t.Fatal("got more events than expected")
t.Error("got more events than expected")
continue
}
if expected[0].Size != event.Size {
@ -453,7 +455,7 @@ func (tp *provider) TestAdd(t *testing.T) {
}
if len(expected) > 0 {
t.Fatalf("%d event(s) didn't arrive", len(expected))
t.Errorf("%d event(s) didn't arrive", len(expected))
}
}()
}