Skip to content

Commit

Permalink
.../input/entityanalytics/provider/okta: Fix flaky tests (#42123)
Browse files Browse the repository at this point in the history
* Fix flaky tests by expanding allowed range by 10x.

* CHANGELOG-developer.next.asciidoc entry.

* Update CHANGELOG-developer.next.asciidoc

Co-authored-by: Dan Kortschak <[email protected]>

---------

Co-authored-by: ShourieG <[email protected]>
Co-authored-by: Dan Kortschak <[email protected]>
  • Loading branch information
3 people authored Dec 24, 2024
1 parent 2e776c7 commit 9b92245
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-developer.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ The list below covers the major changes between 7.0.0-rc2 and main only.
- AWS CloudWatch Metrics record previous endTime to use for next collection period and change log.logger from cloudwatch to aws.cloudwatch. {pull}40870[40870]
- Fix flaky test in cel and httpjson inputs of filebeat. {issue}40503[40503] {pull}41358[41358]
- Fix documentation and implementation of raw message handling in Filebeat http_endpoint by removing it. {pull}41498[41498]
- Fix flaky test in filebeat Okta entity analytics provider. {issue}42059[42059] {pull}42123[42123]

==== Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestRateLimiter(t *testing.T) {
r.Wait(ctx, endpoint, url, log)
wait := time.Since(start)

if wait > 1010*time.Millisecond {
if wait > 1100*time.Millisecond {
t.Errorf("doesn't allow requests to resume after reset. had to wait %s", wait)
}
if e.limiter.Limit() != 1.0 {
Expand All @@ -102,7 +102,7 @@ func TestRateLimiter(t *testing.T) {
e.limiter.SetBurst(100) // increase bucket size to check token accumulation
tokens := e.limiter.TokensAt(time.Unix(0, time.Now().Add(30*time.Second).UnixNano()))
target := 30.0
buffer := 0.01
buffer := 0.1

if tokens < target-buffer || target+buffer < tokens {
t.Errorf("tokens don't accumulate at the expected rate over 30s: %f", tokens)
Expand Down

0 comments on commit 9b92245

Please sign in to comment.