Browse Source

Fix race in test.

Change-Id: I53e1a4c5a6b5f846acd76043166b6cb7bf7d5dc7
pull/413/head
Bjoern Rabenstein 10 years ago
parent
commit
e23ee0f7cc
  1. 2
      storage/local/storage_test.go

2
storage/local/storage_test.go

@ -72,6 +72,7 @@ func TestChunk(t *testing.T) {
s.AppendSamples(samples) s.AppendSamples(samples)
for m := range s.(*memorySeriesStorage).fpToSeries.iter() { for m := range s.(*memorySeriesStorage).fpToSeries.iter() {
s.(*memorySeriesStorage).fpLocker.Lock(m.fp)
for i, v := range m.series.values() { for i, v := range m.series.values() {
if samples[i].Timestamp != v.Timestamp { if samples[i].Timestamp != v.Timestamp {
t.Fatalf("%d. Got %v; want %v", i, v.Timestamp, samples[i].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) t.Fatalf("%d. Got %v; want %v", i, v.Value, samples[i].Value)
} }
} }
s.(*memorySeriesStorage).fpLocker.Unlock(m.fp)
} }
} }

Loading…
Cancel
Save