From 1f87fa6168ea5ffcba06e5fb0de0ad9324b8d09b Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 26 Mar 2019 18:35:13 +0000 Subject: [PATCH] tests: remove t.Fatal from goroutines This commit was moved from ipfs/interface-go-ipfs-core@5f17f8346b441a6105b569084fa020af989b0f4c This commit was moved from ipfs/boxo@ccb4a5c183b98b9dcf40eee0c0ac8e4a317b4ed8 --- core/coreiface/tests/pubsub.go | 4 +++- core/coreiface/tests/unixfs.go | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/coreiface/tests/pubsub.go b/core/coreiface/tests/pubsub.go index bb870de6c..dd05b73cf 100644 --- a/core/coreiface/tests/pubsub.go +++ b/core/coreiface/tests/pubsub.go @@ -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: diff --git a/core/coreiface/tests/unixfs.go b/core/coreiface/tests/unixfs.go index e99bf4429..576160500 100644 --- a/core/coreiface/tests/unixfs.go +++ b/core/coreiface/tests/unixfs.go @@ -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)) } }() }