Skip to content

Commit

Permalink
Fixed e2e. (#2327)
Browse files Browse the repository at this point in the history
Sorry, was late when we merged the fix. Funny bug: It would start to fail exactly 12h AFTER 25.03 8:00 GMT

Should be fine now... and in future until changed ;p

Signed-off-by: Bartlomiej Plotka <[email protected]>
  • Loading branch information
bwplotka authored Mar 26, 2020
1 parent 4dc1684 commit b60b3e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/e2e/compact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestCompactWithStoreGateway(t *testing.T) {
delay := 30 * time.Minute
// Make sure to take realistic timestamp for start. This is to align blocks as if they would be aligned on Prometheus.
// To have deterministic compaction, let's have fixed date:
now, err := time.Parse(time.RFC3339, "2020-03-25T08:00:00Z")
now, err := time.Parse(time.RFC3339, "2020-03-24T08:00:00Z")
testutil.Ok(t, err)

// Simulate real scenario, including more complex cases like overlaps if needed.
Expand Down Expand Up @@ -311,7 +311,7 @@ func TestCompactWithStoreGateway(t *testing.T) {

// Check if query detects current series, even if overlapped.
queryAndAssert(t, ctx, q.HTTPEndpoint(),
fmt.Sprintf(`count_over_time({a="1"}[12h] offset %ds)`, int64(-1*time.Since(now.Add(12*time.Hour)).Seconds())),
fmt.Sprintf(`count_over_time({a="1"}[13h] offset %ds)`, int64(time.Since(now.Add(12*time.Hour)).Seconds())),
promclient.QueryOptions{
Deduplicate: false, // This should be false, so that we can be sure deduplication was offline.
},
Expand Down Expand Up @@ -408,7 +408,7 @@ func TestCompactWithStoreGateway(t *testing.T) {

// Check if query detects new blocks.
queryAndAssert(t, ctx, q.HTTPEndpoint(),
fmt.Sprintf(`count_over_time({a="1"}[12h] offset %ds)`, int64(-1*time.Since(now.Add(12*time.Hour)).Seconds())),
fmt.Sprintf(`count_over_time({a="1"}[13h] offset %ds)`, int64(time.Since(now.Add(12*time.Hour)).Seconds())),
promclient.QueryOptions{
Deduplicate: false, // This should be false, so that we can be sure deduplication was offline.
},
Expand Down

0 comments on commit b60b3e9

Please sign in to comment.