mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 21:54:10 -08:00
Fix race in test.
Change-Id: I53e1a4c5a6b5f846acd76043166b6cb7bf7d5dc7
This commit is contained in:
parent
d73e851b14
commit
e23ee0f7cc
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue