Fix specs failing on main (ignore favicon requests, expect new error) #273
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.
This change aims to fix 5 specs that are currently failing consistently on
main
and 2 specs that are currently flaking fairly frequently. The 5 consistent spec failures can be seen here in the output of a test run for a recently submitted PR (#272). (The failures are not related to the changes being made in that PR.)There are two distinct issues being fixed in this PR.
Problem 1 (causes 4 consistently failing examples and 2 flaky examples): It seems that requests are now being made for
/favicon.ico
that the specs don't seem to expect/account for. Presumably these requests weren't being made before. There might have been some change in Chrome or elsewhere, such that these requests are maybe now made by default, whereas maybe previously they weren't being made by default.Fix: Filter out the
/favicon.ico
requests (instances ofFerrum::Network::Exchange
) in the tests that are currently failing due to the presence of such requests. (This approach is somewhat inelegant/cluttering, and there might be some better possible approach.)Problem 2 (causes 1 consistently failing example): It seems that, now, if a request is made to a URL that is protected by basic authentication, but if basic authentication has not been provided for that request, then a
Ferrum::StatusError
exception will be raised.Fix: Expect/rescue this error in the relevant spec that makes a request without providing credentials to an endpoint that is protected by basic auth.