Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: prometheus-junkyard/tsdb
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 68a23d37e9fae8a2d96c7cc1cfb6ef91bf567aa4
Choose a base ref
..
head repository: prometheus-junkyard/tsdb
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 79a19c90fd95052e525c5561ccf089e89c294b21
Choose a head ref
Showing with 212 additions and 201 deletions.
  1. +3 −3 block_test.go
  2. +13 −13 checkpoint_test.go
  3. +3 −3 compact_test.go
  4. +54 −54 db_test.go
  5. +42 −42 head_test.go
  6. +6 −6 index/index_test.go
  7. +14 −14 index/postings_test.go
  8. +2 −2 labels/labels_test.go
  9. +36 −36 querier_test.go
  10. +3 −3 record_test.go
  11. +1 −1 repair_test.go
  12. +12 −2 testutil/testutil.go
  13. +2 −2 tombstones_test.go
  14. +3 −3 tsdbutil/buffer_test.go
  15. +3 −2 wal/wal_test.go
  16. +15 −15 wal_test.go
6 changes: 3 additions & 3 deletions block_test.go
Original file line number Diff line number Diff line change
@@ -45,14 +45,14 @@ func TestSetCompactionFailed(t *testing.T) {

b := createEmptyBlock(t, tmpdir, &BlockMeta{Version: 2})

testutil.Equals(t, false, b.meta.Compaction.Failed, "")
testutil.Equals(t, false, b.meta.Compaction.Failed)
testutil.Ok(t, b.setCompactionFailed())
testutil.Equals(t, true, b.meta.Compaction.Failed, "")
testutil.Equals(t, true, b.meta.Compaction.Failed)
testutil.Ok(t, b.Close())

b, err = OpenBlock(tmpdir, nil)
testutil.Ok(t, err)
testutil.Equals(t, true, b.meta.Compaction.Failed, "")
testutil.Equals(t, true, b.meta.Compaction.Failed)
}

// createEmpty block creates a block with the given meta but without any data.
26 changes: 13 additions & 13 deletions checkpoint_test.go
Original file line number Diff line number Diff line change
@@ -32,31 +32,31 @@ func TestLastCheckpoint(t *testing.T) {
defer os.RemoveAll(dir)

s, k, err := LastCheckpoint(dir)
testutil.Equals(t, ErrNotFound, err, "")
testutil.Equals(t, ErrNotFound, err)

testutil.Ok(t, os.MkdirAll(filepath.Join(dir, "checkpoint.0000"), 0777))
s, k, err = LastCheckpoint(dir)
testutil.Ok(t, err)
testutil.Equals(t, "checkpoint.0000", s, "")
testutil.Equals(t, 0, k, "")
testutil.Equals(t, "checkpoint.0000", s)
testutil.Equals(t, 0, k)

testutil.Ok(t, os.MkdirAll(filepath.Join(dir, "checkpoint.xyz"), 0777))
s, k, err = LastCheckpoint(dir)
testutil.Ok(t, err)
testutil.Equals(t, "checkpoint.0000", s, "")
testutil.Equals(t, 0, k, "")
testutil.Equals(t, "checkpoint.0000", s)
testutil.Equals(t, 0, k)

testutil.Ok(t, os.MkdirAll(filepath.Join(dir, "checkpoint.1"), 0777))
s, k, err = LastCheckpoint(dir)
testutil.Ok(t, err)
testutil.Equals(t, "checkpoint.1", s, "")
testutil.Equals(t, 1, k, "")
testutil.Equals(t, "checkpoint.1", s)
testutil.Equals(t, 1, k)

testutil.Ok(t, os.MkdirAll(filepath.Join(dir, "checkpoint.1000"), 0777))
s, k, err = LastCheckpoint(dir)
testutil.Ok(t, err)
testutil.Equals(t, "checkpoint.1000", s, "")
testutil.Equals(t, 1000, k, "")
testutil.Equals(t, "checkpoint.1000", s)
testutil.Equals(t, 1000, k)
}

func TestDeleteCheckpoints(t *testing.T) {
@@ -75,7 +75,7 @@ func TestDeleteCheckpoints(t *testing.T) {

files, err := fileutil.ReadDir(dir)
testutil.Ok(t, err)
testutil.Equals(t, []string{"checkpoint.02", "checkpoint.03"}, files, "")
testutil.Equals(t, []string{"checkpoint.02", "checkpoint.03"}, files)
}

func TestCheckpoint(t *testing.T) {
@@ -145,8 +145,8 @@ func TestCheckpoint(t *testing.T) {
// Only the new checkpoint should be left.
files, err := fileutil.ReadDir(dir)
testutil.Ok(t, err)
testutil.Equals(t, 1, len(files), "")
testutil.Equals(t, "checkpoint.000106", files[0], "")
testutil.Equals(t, 1, len(files))
testutil.Equals(t, "checkpoint.000106", files[0])

sr, err := wal.NewSegmentsReader(filepath.Join(dir, "checkpoint.000106"))
testutil.Ok(t, err)
@@ -176,5 +176,5 @@ func TestCheckpoint(t *testing.T) {
{Ref: 0, Labels: labels.FromStrings("a", "b", "c", "0")},
{Ref: 2, Labels: labels.FromStrings("a", "b", "c", "2")},
{Ref: 4, Labels: labels.FromStrings("a", "b", "c", "4")},
}, series, "")
}, series)
}
6 changes: 3 additions & 3 deletions compact_test.go
Original file line number Diff line number Diff line change
@@ -123,7 +123,7 @@ func TestSplitByRange(t *testing.T) {
}
}

testutil.Equals(t, exp, splitByRange(blocks, c.trange), "")
testutil.Equals(t, exp, splitByRange(blocks, c.trange))
}
}

@@ -309,7 +309,7 @@ func TestLeveledCompactor_plan(t *testing.T) {
res, err := compactor.plan(c.metas)
testutil.Ok(t, err)

testutil.Equals(t, c.expected, res, "")
testutil.Equals(t, c.expected, res)
}) {
return
}
@@ -362,7 +362,7 @@ func TestRangeWithFailedCompactionWontGetSelected(t *testing.T) {
res, err := compactor.plan(c.metas)
testutil.Ok(t, err)

testutil.Equals(t, []string(nil), res, "")
testutil.Equals(t, []string(nil), res)
}
}

Loading