Skip to content

Commit

Permalink
update unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jesus Vazquez <[email protected]>
  • Loading branch information
jesusvazquez committed Jan 2, 2025
1 parent 1e9d95a commit d8187ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tsdb/head_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6114,13 +6114,16 @@ func TestAppendQuietZeroDuplicates(t *testing.T) {
a = h.Appender(context.Background())
_, err = a.Append(0, lbls, ts+10, math.Float64frombits(value.QuietZeroNaN)) // This is at a different timestamp so should append a real zero.
require.NoError(t, err)
_, err = a.Append(0, lbls, ts+15, 5.0) // We append a normal value to reflect what would happen in reality.
require.NoError(t, err)
require.NoError(t, a.Commit())

result, err = queryHead(t, h, math.MinInt64, math.MaxInt64, labels.Label{Name: "foo", Value: "bar"})
require.NoError(t, err)
expectedSamples = []chunks.Sample{
sample{t: ts, f: 42.0},
sample{t: ts + 10, f: 0},
sample{t: ts + 15, f: 5},
}
require.Equal(t, expectedSamples, result[`{foo="bar"}`])

Expand Down

0 comments on commit d8187ec

Please sign in to comment.