mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-25 20:37:53 +08:00
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:
parent
6190be29b9
commit
1f87fa6168
@ -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:
|
||||
|
||||
@ -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))
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user