Skip to content

Commit

Permalink
Increased time in summary test
Browse files Browse the repository at this point in the history
max_age was set to 1ms which was too short for testing and the
quantiles would have expired for the metric assertion in
which there were supposed to have not expired.

Now it is set to 1s and then it waits 2s for the quantiles
to expire.
  • Loading branch information
mapno committed May 13, 2019
1 parent b099342 commit 5f53a6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func Test_SummaryWithSpecifiedMaxAge(t *testing.T) {
summaryHelp := "Uses default value for max age"

var metrics struct {
Summary func() prometheus.Summary `name:"without_max_age" help:"Uses default value for max age" max_age:"1ms"`
Summary func() prometheus.Summary `name:"without_max_age" help:"Uses default value for max age" max_age:"1s"`
}

err := gotoprom.Init(&metrics, "test")
Expand All @@ -308,7 +308,7 @@ func Test_SummaryWithSpecifiedMaxAge(t *testing.T) {
err = testutil.GatherAndCompare(prometheus.DefaultGatherer, strings.NewReader(expectedUnexpired), "test_without_max_age")
assert.NoError(t, err)

time.Sleep(time.Millisecond)
time.Sleep(time.Second * 2)

mfs, err := prometheus.DefaultGatherer.Gather()
assert.NoError(t, err)
Expand Down

0 comments on commit 5f53a6e

Please sign in to comment.