|
|
|
@ -118,11 +118,11 @@ func TestHead_ReadWAL(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
w, err := wal.New(nil, nil, dir) |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
defer w.Close() |
|
|
|
|
populateTestWAL(t, w, entries) |
|
|
|
|
|
|
|
|
|
head, err := NewHead(nil, nil, w, 1000) |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
defer head.Close() |
|
|
|
|
|
|
|
|
|
testutil.Ok(t, head.Init(math.MinInt64)) |
|
|
|
|
testutil.Equals(t, uint64(100), head.lastSeriesID) |
|
|
|
@ -282,11 +282,11 @@ func TestHeadDeleteSeriesWithoutSamples(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
w, err := wal.New(nil, nil, dir) |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
defer w.Close() |
|
|
|
|
populateTestWAL(t, w, entries) |
|
|
|
|
|
|
|
|
|
head, err := NewHead(nil, nil, w, 1000) |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
defer head.Close() |
|
|
|
|
|
|
|
|
|
testutil.Ok(t, head.Init(math.MinInt64)) |
|
|
|
|
|
|
|
|
@ -389,6 +389,7 @@ Outer:
|
|
|
|
|
func TestDeleteUntilCurMax(t *testing.T) { |
|
|
|
|
numSamples := int64(10) |
|
|
|
|
hb, err := NewHead(nil, nil, nil, 1000000) |
|
|
|
|
defer hb.Close() |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
app := hb.Appender() |
|
|
|
|
smpls := make([]float64, numSamples) |
|
|
|
@ -478,6 +479,7 @@ func TestDelete_e2e(t *testing.T) {
|
|
|
|
|
defer os.RemoveAll(dir) |
|
|
|
|
hb, err := NewHead(nil, nil, nil, 100000) |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
defer hb.Close() |
|
|
|
|
app := hb.Appender() |
|
|
|
|
for _, l := range lbls { |
|
|
|
|
ls := labels.New(l...) |
|
|
|
@ -845,6 +847,7 @@ func TestHead_LogRollback(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
w, err := wal.New(nil, nil, dir) |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
defer w.Close() |
|
|
|
|
h, err := NewHead(nil, nil, w, 1000) |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
|
|
|
|
@ -911,6 +914,7 @@ func TestWalRepair(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
w, err := wal.New(nil, nil, dir) |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
defer w.Close() |
|
|
|
|
|
|
|
|
|
for i := 1; i <= test.totalRecs; i++ { |
|
|
|
|
// At this point insert a corrupted record.
|
|
|
|
@ -936,7 +940,6 @@ func TestWalRepair(t *testing.T) {
|
|
|
|
|
} |
|
|
|
|
testutil.Ok(t, r.Err()) |
|
|
|
|
testutil.Equals(t, test.expRecs, actRec, "Wrong number of intact records") |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|