From e23ee0f7cc2615d73a5989e83c1a7bc78150b810 Mon Sep 17 00:00:00 2001 From: Bjoern Rabenstein Date: Thu, 13 Nov 2014 17:11:39 +0100 Subject: [PATCH] Fix race in test. Change-Id: I53e1a4c5a6b5f846acd76043166b6cb7bf7d5dc7 --- storage/local/storage_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/storage/local/storage_test.go b/storage/local/storage_test.go index c3bef565d..2f76c1482 100644 --- a/storage/local/storage_test.go +++ b/storage/local/storage_test.go @@ -72,6 +72,7 @@ func TestChunk(t *testing.T) { s.AppendSamples(samples) for m := range s.(*memorySeriesStorage).fpToSeries.iter() { + s.(*memorySeriesStorage).fpLocker.Lock(m.fp) for i, v := range m.series.values() { if samples[i].Timestamp != v.Timestamp { t.Fatalf("%d. Got %v; want %v", i, v.Timestamp, samples[i].Timestamp) @@ -80,6 +81,7 @@ func TestChunk(t *testing.T) { t.Fatalf("%d. Got %v; want %v", i, v.Value, samples[i].Value) } } + s.(*memorySeriesStorage).fpLocker.Unlock(m.fp) } }