-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x-pack/filebeat/input/{cel,httpjson}: fix flaky test
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/[email protected]#section-readme
- Loading branch information
Showing
3 changed files
with
5 additions
and
4 deletions.
There are no files selected for viewing
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
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
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