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
Steven Allen committed
Mar 26, 2019 at 18:35 UTC
1f87fa6168ea5ffcba06e5fb0de0ad9324b8d09b
2 files changed
+8
-4
core/coreiface/tests/pubsub.go
+3
-1
@@ -40,7 +40,9 @@ func (tp *provider) TestBasicPubSub(t *testing.T) {
40
for {
41
err := apis[1].PubSub().Publish(ctx, "testch", []byte("hello world"))
42
if err != nil {
43
- t.Fatal(err)
43
+ t.Error(err)
44
+ cancel()
45
+ return
46
}
47
select {
48
case <-tick:
core/coreiface/tests/unixfs.go
+5
-3
@@ -423,11 +423,13 @@ func (tp *provider) TestAdd(t *testing.T) {
423
for evt := range eventOut {
424
event, ok := evt.(*coreiface.AddEvent)
425
if !ok {
426
- t.Fatal("unexpected event type")
426
+ t.Error("unexpected event type")
427
+ continue
428
}
429
430
if len(expected) < 1 {
430
- t.Fatal("got more events than expected")
431
+ t.Error("got more events than expected")
432
+ continue
433
}
434
435
if expected[0].Size != event.Size {
@@ -453,7 +455,7 @@ func (tp *provider) TestAdd(t *testing.T) {
455
}
456
457
if len(expected) > 0 {
456
- t.Fatalf("%d event(s) didn't arrive", len(expected))
458
+ t.Errorf("%d event(s) didn't arrive", len(expected))
459
}
460
}()
461
}