Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions bitswap/bitswap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func TestEmptyKey(t *testing.T) {

_, err := bs.GetBlock(ctx, cid.Cid{})
if !ipld.IsNotFound(err) {
t.Error("empty str key should return ErrNotFound")
t.Error("empty string key should return ErrNotFound")
}
}

Expand Down Expand Up @@ -442,7 +442,7 @@ func TestBasicBitswap(t *testing.T) {
return errors.New("should have no items in other peers wantlist")
}
if len(instances[1].Exchange.GetWantlist()) != 0 {
return errors.New("shouldnt have anything in wantlist")
return errors.New("should not have anything in wantlist")
}
return nil
}); err != nil {
Expand Down Expand Up @@ -531,7 +531,7 @@ func TestDoubleGet(t *testing.T) {
case <-time.After(time.Second * 5):
p1wl := instances[0].Exchange.WantlistForPeer(instances[1].Identity.ID())
if len(p1wl) != 1 {
t.Logf("wantlist view didnt have 1 item (had %d)", len(p1wl))
t.Logf("wantlist view did not have 1 item (had %d)", len(p1wl))
} else if !p1wl[0].Equals(blocks[0].Cid()) {
t.Logf("had 1 item, it was wrong: %s %s", blocks[0].Cid(), p1wl[0])
} else {
Expand Down Expand Up @@ -569,13 +569,13 @@ func TestWantlistCleanup(t *testing.T) {
defer cancel()
_, err := bswap.GetBlock(ctx, keys[0])
if err != context.DeadlineExceeded {
t.Fatal("shouldnt have fetched any blocks")
t.Fatal("should not have fetched any blocks")
}

time.Sleep(time.Millisecond * 50)

if len(bswap.GetWantHaves()) > 0 {
t.Fatal("should not have anyting in wantlist")
t.Fatal("should not have anything in wantlist")
}

// Once context times out, keys should be removed from wantlist
Expand All @@ -590,7 +590,7 @@ func TestWantlistCleanup(t *testing.T) {
time.Sleep(time.Millisecond * 50)

if len(bswap.GetWantHaves()) > 0 {
t.Fatal("should not have anyting in wantlist")
t.Fatal("should not have anything in wantlist")
}

// Send want for single block, with no timeout
Expand All @@ -606,7 +606,7 @@ func TestWantlistCleanup(t *testing.T) {
t.Fatal(err)
}

// Even after 50 milli-seconds we haven't explicitly cancelled anything
// Even after 50 milliseconds we haven't explicitly canceled anything
// and no timeouts have expired, so we should have 11 want-haves
time.Sleep(time.Millisecond * 50)
if len(bswap.GetWantHaves()) != 11 {
Expand Down