Skip to content

Commit

Permalink
Merge pull request #37 from intergral/counter_test
Browse files Browse the repository at this point in the history
fix(test): try fix counter test
  • Loading branch information
Umaaz committed Jul 17, 2023
2 parents 45579d7 + 103cefa commit d862280
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/generator/registry/counter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import (
"go.uber.org/atomic"
)

// disabled this test as it is not reliable
// the logic is fine, but it relies on timing, which periodically fails.
func Test_counter(t *testing.T) {
var seriesAdded int
onAdd := func(count uint32) bool {
Expand Down Expand Up @@ -56,7 +58,6 @@ func Test_counter(t *testing.T) {

assert.Equal(t, 3, seriesAdded)

collectionTimeMs = time.Now().UnixMilli()
expectedSamples = []sample{
newSample(map[string]string{"__name__": "my_counter", "label": "value-1"}, collectionTimeMs, 1),
newSample(map[string]string{"__name__": "my_counter", "label": "value-2"}, collectionTimeMs, 4),
Expand Down

0 comments on commit d862280

Please sign in to comment.