Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
chore: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Mar 23, 2020
1 parent 3e11d01 commit 2bb6390
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
21 changes: 16 additions & 5 deletions blockservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ func TestWriteThroughWorks(t *testing.T) {
block := bgen.Next()

t.Logf("PutCounter: %d", bstore.PutCounter)
bserv.AddBlock(block)
err := bserv.AddBlock(block)
if err != nil {
t.Fatal(err)
}
if bstore.PutCounter != 1 {
t.Fatalf("expected just one Put call, have: %d", bstore.PutCounter)
}

bserv.AddBlock(block)
err = bserv.AddBlock(block)
if err != nil {
t.Fatal(err)
}
if bstore.PutCounter != 2 {
t.Fatalf("Put should have called again, should be 2 is: %d", bstore.PutCounter)
}
Expand All @@ -52,10 +58,15 @@ func TestLazySessionInitialization(t *testing.T) {
bgen := butil.NewBlockGenerator()

block := bgen.Next()
bstore.Put(block)

err := bstore.Put(block)
if err != nil {
t.Fatal(err)
}
block2 := bgen.Next()
session.HasBlock(block2)
err = session.HasBlock(block2)
if err != nil {
t.Fatal(err)
}

bsession := NewSession(ctx, bservSessEx)
if bsession.ses != nil {
Expand Down
5 changes: 4 additions & 1 deletion test/blocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ func TestGetBlocksSequential(t *testing.T) {
var cids []cid.Cid
for _, o := range objs {
cids = append(cids, o.Cid())
servs[0].AddBlock(o)
err := servs[0].AddBlock(o)
if err != nil {
t.Fatal(err)
}
}

t.Log("one instance at a time, get blocks concurrently")
Expand Down

0 comments on commit 2bb6390

Please sign in to comment.