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

Fix coverage report error (#288)

parent 5eaf38e8
......@@ -698,7 +698,6 @@ func addRandomChunks(t *testing.T, count int, db *DB, pin bool) []swarm.Chunk {
if err != nil {
t.Fatal(err)
}
}
err = db.Set(context.Background(), storage.ModeSetSyncPull, ch.Address())
if err != nil {
t.Fatal(err)
......@@ -711,6 +710,13 @@ func addRandomChunks(t *testing.T, count int, db *DB, pin bool) []swarm.Chunk {
if err != nil {
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)
}
return chunks
......
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