From dde6b11e42325b1b5ef07cca62c9de8e8205c896 Mon Sep 17 00:00:00 2001 From: Janos Guljas Date: Fri, 18 Jan 2019 16:23:39 +0100 Subject: [PATCH] swarm/storage: user read locks in TestLDBStoreCollectGarbage --- swarm/storage/ldbstore_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/swarm/storage/ldbstore_test.go b/swarm/storage/ldbstore_test.go index e8ff9c444b..0aada7347e 100644 --- a/swarm/storage/ldbstore_test.go +++ b/swarm/storage/ldbstore_test.go @@ -388,9 +388,9 @@ func testLDBStoreCollectGarbage(t *testing.T) { t.Fatal(err.Error()) } allChunks = append(allChunks, chunks...) - ldb.lock.Lock() + ldb.lock.RLock() log.Debug("ldbstore", "entrycnt", ldb.entryCnt, "accesscnt", ldb.accessCnt, "cap", capacity, "n", n) - ldb.lock.Unlock() + ldb.lock.RUnlock() ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) defer cancel() @@ -539,9 +539,9 @@ func testLDBStoreRemoveThenCollectGarbage(t *testing.T) { remaining -= putCount for putCount > 0 { ldb.Put(context.TODO(), chunks[puts]) - ldb.lock.Lock() + ldb.lock.RLock() log.Debug("ldbstore", "entrycnt", ldb.entryCnt, "accesscnt", ldb.accessCnt, "cap", capacity, "n", n, "puts", puts, "remaining", remaining, "roundtarget", roundTarget) - ldb.lock.Unlock() + ldb.lock.RUnlock() puts++ putCount-- }