mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31:11 -08:00
fixed an issue in TestWALRestoreCorrupted
This commit is contained in:
parent
d45b595a1d
commit
cadae47522
|
@ -19,6 +19,7 @@ import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/go-kit/kit/log"
|
"github.com/go-kit/kit/log"
|
||||||
"github.com/prometheus/tsdb/fileutil"
|
"github.com/prometheus/tsdb/fileutil"
|
||||||
|
@ -370,6 +371,11 @@ func TestWALRestoreCorrupted(t *testing.T) {
|
||||||
|
|
||||||
testutil.Ok(t, w.cut())
|
testutil.Ok(t, w.cut())
|
||||||
|
|
||||||
|
//Sleep 2 seconds to avoid error where cut and test "cases" function may write or
|
||||||
|
//truncate the file out of orders as "cases" are not synchronized with cut.
|
||||||
|
//Hopefully cut will complete by 2 seconds
|
||||||
|
time.Sleep(2 * time.Second)
|
||||||
|
|
||||||
testutil.Ok(t, w.LogSamples([]RefSample{{T: 3, V: 4}}))
|
testutil.Ok(t, w.LogSamples([]RefSample{{T: 3, V: 4}}))
|
||||||
testutil.Ok(t, w.LogSamples([]RefSample{{T: 5, V: 6}}))
|
testutil.Ok(t, w.LogSamples([]RefSample{{T: 5, V: 6}}))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue