From 822f787c1ba2edaf4e6351920c63c08c2625d7dd Mon Sep 17 00:00:00 2001 From: Ryan Hall Date: Mon, 28 Sep 2020 17:00:19 -0700 Subject: [PATCH] Fix data race in TestSeekerManagerCacheShardIndices --- src/dbnode/persist/fs/seek_manager_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dbnode/persist/fs/seek_manager_test.go b/src/dbnode/persist/fs/seek_manager_test.go index 8d27e2cb63..ebe9a15e65 100644 --- a/src/dbnode/persist/fs/seek_manager_test.go +++ b/src/dbnode/persist/fs/seek_manager_test.go @@ -73,7 +73,9 @@ func TestSeekerManagerCacheShardIndices(t *testing.T) { // Assert captured byTime objects match expectations require.Equal(t, len(shards), len(byTimes)) for _, shard := range shards { + mu.Lock() byTimes[shard].shard = shard + mu.Unlock() } // Assert seeksByShardIdx match expectations