Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip flaky test TestRateLimiter #42120

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
})

t.Run("Update stops requests when none are remaining", func(t *testing.T) {
t.Skip("Flaky test: https://github.com/elastic/beats/issues/42059")
const window = time.Minute
var fixedLimit *int = nil
r := NewRateLimiter(window, fixedLimit)
Expand Down Expand Up @@ -83,7 +84,7 @@
e = r.endpoint(endpoint)

start := time.Now()
r.Wait(ctx, endpoint, url, log)

Check failure on line 87 in x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta/ratelimiter_test.go

View workflow job for this annotation

GitHub Actions / lint (windows)

Error return value of `r.Wait` is not checked (errcheck)

Check failure on line 87 in x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta/ratelimiter_test.go

View workflow job for this annotation

GitHub Actions / lint (linux)

Error return value of `r.Wait` is not checked (errcheck)
wait := time.Since(start)

if wait > 1010*time.Millisecond {
Expand Down Expand Up @@ -126,8 +127,8 @@
log := logp.L()
ctx := context.Background()

r.Wait(ctx, endpoint, url, log) // consume the initial request

Check failure on line 130 in x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta/ratelimiter_test.go

View workflow job for this annotation

GitHub Actions / lint (windows)

Error return value of `r.Wait` is not checked (errcheck)

Check failure on line 130 in x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta/ratelimiter_test.go

View workflow job for this annotation

GitHub Actions / lint (linux)

Error return value of `r.Wait` is not checked (errcheck)
r.Update(endpoint, headers, log) // update to a slow rate

Check failure on line 131 in x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta/ratelimiter_test.go

View workflow job for this annotation

GitHub Actions / lint (windows)

Error return value of `r.Update` is not checked (errcheck)

Check failure on line 131 in x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta/ratelimiter_test.go

View workflow job for this annotation

GitHub Actions / lint (linux)

Error return value of `r.Update` is not checked (errcheck)

err = r.Wait(ctx, endpoint, url, log)

Expand All @@ -141,7 +142,7 @@

t.Run("A fixed limit overrides response information", func(t *testing.T) {
const window = time.Minute
var fixedLimit int = 120

Check failure on line 145 in x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta/ratelimiter_test.go

View workflow job for this annotation

GitHub Actions / lint (windows)

ST1023: should omit type int from declaration; it will be inferred from the right-hand side (stylecheck)

Check failure on line 145 in x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta/ratelimiter_test.go

View workflow job for this annotation

GitHub Actions / lint (linux)

ST1023: should omit type int from declaration; it will be inferred from the right-hand side (stylecheck)
r := NewRateLimiter(window, &fixedLimit)
const endpoint = "/foo"
e := r.endpoint(endpoint)
Expand Down
Loading