Skip to content

Commit 7a52547

Browse files
committed
fix: update GCM tests after GCM fixed delta alignment issue
Signed-off-by: bwplotka <bwplotka@google.com>
1 parent 3936f6a commit 7a52547

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

pkg/export/gcm/export_gcm_test.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,41 +66,38 @@ func TestExport_CounterReset(t *testing.T) {
6666
counter.Reset()
6767
c = counter.WithLabelValues("bar")
6868
scrape(interval).
69-
// NOTE(bwplotka): This and following discrepancies are expected due to
70-
// GCM PromQL layer using MQL with delta alignment. What we get as a raw
71-
// counter is already reset-normalized (b/305901765) (plus cannibalization).
72-
Expect(50, c, export).
69+
Expect(0, c, export).
7370
Expect(0, c, prom)
7471

7572
c.Add(150)
7673
scrape(interval).
77-
Expect(200, c, export).
74+
Expect(150, c, export).
7875
Expect(150, c, prom)
7976

8077
// Reset to 0 with addition.
8178
counter.Reset()
8279
c = counter.WithLabelValues("bar")
8380
c.Add(20)
8481
scrape(interval).
85-
Expect(220, c, export).
82+
Expect(20, c, export).
8683
Expect(20, c, prom)
8784

8885
c.Add(50)
8986
scrape(interval).
90-
Expect(270, c, export).
87+
Expect(70, c, export).
9188
Expect(70, c, prom)
9289

9390
c.Add(10)
9491
scrape(interval).
95-
Expect(280, c, export).
92+
Expect(80, c, export).
9693
Expect(80, c, prom)
9794

9895
// Tricky reset case, unnoticeable reset for Prometheus without created timestamp as well.
9996
counter.Reset()
10097
c = counter.WithLabelValues("bar")
10198
c.Add(600)
10299
scrape(interval).
103-
Expect(800, c, export).
100+
Expect(600, c, export).
104101
Expect(600, c, prom)
105102
})
106103

0 commit comments

Comments
 (0)