Commit 6c85c5c8 authored by Zahoor Mohamed's avatar Zahoor Mohamed Committed by GitHub

Fix coverage report error (#288)

parent 5eaf38e8
...@@ -698,18 +698,24 @@ func addRandomChunks(t *testing.T, count int, db *DB, pin bool) []swarm.Chunk { ...@@ -698,18 +698,24 @@ func addRandomChunks(t *testing.T, count int, db *DB, pin bool) []swarm.Chunk {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
} err = db.Set(context.Background(), storage.ModeSetSyncPull, ch.Address())
err = db.Set(context.Background(), storage.ModeSetSyncPull, ch.Address()) if err != nil {
if err != nil { t.Fatal(err)
t.Fatal(err) }
} err = db.Set(context.Background(), storage.ModeSetAccess, ch.Address())
err = db.Set(context.Background(), storage.ModeSetAccess, ch.Address()) if err != nil {
if err != nil { t.Fatal(err)
t.Fatal(err) }
} _, err = db.Get(context.Background(), storage.ModeGetRequest, ch.Address())
_, err = db.Get(context.Background(), storage.ModeGetRequest, ch.Address()) if err != nil {
if err != nil { t.Fatal(err)
t.Fatal(err) }
} else {
// Non pinned chunks could be GC'd by the time they reach here.
// so it is okay to ignore the error
_ = db.Set(context.Background(), storage.ModeSetSyncPull, ch.Address())
_ = db.Set(context.Background(), storage.ModeSetAccess, ch.Address())
_, _ = db.Get(context.Background(), storage.ModeGetRequest, ch.Address())
} }
chunks = append(chunks, ch) chunks = append(chunks, ch)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment