-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
x-pack/filebeat/input/{cel,httpjson}: fix flaky test #41358
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Do not use uncontrolled randomisation in tests where it is not necessary. The retry tests in the httpjson and cel packages were using a randomised 5xx HTTP status code to trigger the retry behaviour of the the go-retryablehttp package. This had the unfortunate consequence of causing 1% of test runs to fail. The reason for this is given in the go-retryablehttp documentation[1]: Mainly, if an error is returned by the client (connection errors, etc.), or if a 500-range response code is received (except 501), then a retry is invoked after a wait period. Since the package is already tested, and is documented to accept all 5xx status codes except 501 to cause a retry, just use 500. [1]https://pkg.go.dev/github.com/hashicorp/go-retryablehttp@v0.7.7#section-readme
|
f75ce67
to
c46b21d
Compare
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
chrisberkhout
approved these changes
Oct 23, 2024
mergify bot
pushed a commit
that referenced
this pull request
Oct 23, 2024
Do not use uncontrolled randomisation in tests where it is not necessary. The retry tests in the httpjson and cel packages were using a randomised 5xx HTTP status code to trigger the retry behaviour of the the go-retryablehttp package. This has the unfortunate consequence of causing 2% of test runs to fail. The reason for this is given in the go-retryablehttp documentation[1]: Mainly, if an error is returned by the client (connection errors, etc.), or if a 500-range response code is received (except 501), then a retry is invoked after a wait period. Since the package is already tested, and is documented to accept all 5xx status codes except 501 to cause a retry, just use 500. [1]https://pkg.go.dev/github.com/hashicorp/go-retryablehttp@v0.7.7#section-readme (cherry picked from commit 794b832) # Conflicts: # x-pack/filebeat/input/cel/input_test.go # x-pack/filebeat/input/httpjson/input_test.go
6 tasks
mergify bot
pushed a commit
that referenced
this pull request
Oct 23, 2024
Do not use uncontrolled randomisation in tests where it is not necessary. The retry tests in the httpjson and cel packages were using a randomised 5xx HTTP status code to trigger the retry behaviour of the the go-retryablehttp package. This has the unfortunate consequence of causing 2% of test runs to fail. The reason for this is given in the go-retryablehttp documentation[1]: Mainly, if an error is returned by the client (connection errors, etc.), or if a 500-range response code is received (except 501), then a retry is invoked after a wait period. Since the package is already tested, and is documented to accept all 5xx status codes except 501 to cause a retry, just use 500. [1]https://pkg.go.dev/github.com/hashicorp/go-retryablehttp@v0.7.7#section-readme (cherry picked from commit 794b832)
6 tasks
efd6
added a commit
that referenced
this pull request
Oct 24, 2024
Do not use uncontrolled randomisation in tests where it is not necessary. The retry tests in the httpjson and cel packages were using a randomised 5xx HTTP status code to trigger the retry behaviour of the the go-retryablehttp package. This has the unfortunate consequence of causing 2% of test runs to fail. The reason for this is given in the go-retryablehttp documentation[1]: Mainly, if an error is returned by the client (connection errors, etc.), or if a 500-range response code is received (except 501), then a retry is invoked after a wait period. Since the package is already tested, and is documented to accept all 5xx status codes except 501 to cause a retry, just use 500. [1]https://pkg.go.dev/github.com/hashicorp/go-retryablehttp@v0.7.7#section-readme (cherry picked from commit 794b832) Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
efd6
added a commit
that referenced
this pull request
Oct 24, 2024
…ky test (#41405) * x-pack/filebeat/input/{cel,httpjson}: fix flaky test (#41358) Do not use uncontrolled randomisation in tests where it is not necessary. The retry tests in the httpjson and cel packages were using a randomised 5xx HTTP status code to trigger the retry behaviour of the the go-retryablehttp package. This has the unfortunate consequence of causing 2% of test runs to fail. The reason for this is given in the go-retryablehttp documentation[1]: Mainly, if an error is returned by the client (connection errors, etc.), or if a 500-range response code is received (except 501), then a retry is invoked after a wait period. Since the package is already tested, and is documented to accept all 5xx status codes except 501 to cause a retry, just use 500. [1]https://pkg.go.dev/github.com/hashicorp/go-retryablehttp@v0.7.7#section-readme (cherry picked from commit 794b832) # Conflicts: # x-pack/filebeat/input/cel/input_test.go # x-pack/filebeat/input/httpjson/input_test.go remove: * redundant changelog entries * cel tests * conflicts in httpjson tests --------- Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport-7.17
Automated backport to the 7.17 branch with mergify
backport-8.x
Automated backport to the 8.x branch with mergify
bugfix
Filebeat
Filebeat
Team:Security-Service Integrations
Security Service Integrations Team
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed commit message
Do not use uncontrolled randomisation in tests where it is not necessary. The retry tests in the httpjson and cel packages were using a randomised 5xx HTTP status code to trigger the retry behaviour of the the go-retryablehttp package. This had the unfortunate consequence of causing 2% of test runs to fail.
The reason for this is given in the go-retryablehttp documentation[1]:
Since the package is already tested, and is documented to accept all 5xx status codes except 501 to cause a retry, just use 500.
[1]https://pkg.go.dev/github.com/hashicorp/go-retryablehttp@v0.7.7#section-readme
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs