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

better failure debug for fetch url tests #18451

Merged
merged 1 commit into from
Feb 6, 2018
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions test/extended/image_ecosystem/sample_repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func NewSampleRepoTest(c SampleRepoConfig) func() {
if strings.Contains(response, c.expectedString) {
return true, nil
}
e2e.Logf("url check got %s, expected it to contain %s", response, c.expectedString)
return false, nil
})
o.Expect(response).Should(o.ContainSubstring(c.expectedString))
Expand Down
6 changes: 6 additions & 0 deletions test/extended/util/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,12 @@ func FetchURL(url string, retryTimeout time.Duration) (response string, err erro
if err != nil || r.StatusCode != 200 {
// lie to the poller that we didn't get an error even though we did
// because otherwise it's going to give up.
if err != nil {
e2e.Logf("error fetching url: %v", err)
}
if r != nil {
e2e.Logf("non-200 status code fetching url: %d", r.StatusCode)
}
return false, nil
}
defer r.Body.Close()
Expand Down