Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upTest redirect_count boundaries in Fetch #9391
Merged
Conversation
tests/unit/net/fetch.rs
Outdated
|
|
||
| let fetch_response = test_fetch_redirect_count(MESSAGE, redirect_cap); | ||
|
|
||
| if Response::is_network_error(&fetch_response) { |
This comment has been minimized.
This comment has been minimized.
tests/unit/net/fetch.rs
Outdated
|
|
||
| let fetch_response = test_fetch_redirect_count(MESSAGE, redirect_cap); | ||
|
|
||
| if !Response::is_network_error(&fetch_response) { |
This comment has been minimized.
This comment has been minimized.
|
Go ahead and address my comments and squash all the commits together. |
0ca19f1
to
5426df3
|
@jdm updated and squashed! I also ran tidy-test to make sure I didn't miss anything. |
|
@bors-servo: r+ |
|
|
bors-servo
added a commit
that referenced
this pull request
Jan 20, 2016
Test redirect_count boundaries in Fetch I've written two new tests for Fetch: one to test the highest possible number of redirects succeeds; and another to ensure a failure in Fetch by requesting too many redirects. I also wrote a helper function to be used by each test, since the main difference is how many times they try to redirect. I've also changed the check against redirect_count in http_network fetch to compare it as greater than or equal to 20, as opposed to being only equal to 20. That's outside of the spec, but in my experience testing for pure equality can easily create errors. Even though it's technically not possible for redirect_count be above 20, bizarre bugs during runtime certainly happen. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9391) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry |
|
|
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
nikkisquared commentedJan 20, 2016
I've written two new tests for Fetch: one to test the highest possible number of redirects succeeds; and another to ensure a failure in Fetch by requesting too many redirects. I also wrote a helper function to be used by each test, since the main difference is how many times they try to redirect.
I've also changed the check against redirect_count in http_network fetch to compare it as greater than or equal to 20, as opposed to being only equal to 20. That's outside of the spec, but in my experience testing for pure equality can easily create errors. Even though it's technically not possible for redirect_count be above 20, bizarre bugs during runtime certainly happen.