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

Fix portforward flake #2824

Merged
merged 2 commits into from
Sep 6, 2019

Conversation

balopat
Copy link
Contributor

@balopat balopat commented Sep 6, 2019

Fixes #2787.

@@ -315,21 +315,22 @@ func assertResponseFromPort(t *testing.T, port int, expected string) {
case <-ctx.Done():
t.Fatalf("Timed out waiting for response from port %d", port)
case <-time.After(1 * time.Second):
resp, err := http.Get(fmt.Sprintf("http://%s:%d", util.Loopback, port))
client := http.Client{Timeout: 1 * time.Second}
Copy link
Contributor Author

@balopat balopat Sep 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the fix - I expect that sometimes the client would just hang in broken connections causing the flake. This helps get over that issue and forces a retry.

@codecov
Copy link

codecov bot commented Sep 6, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@a977c83). Click here to learn what that means.
The diff coverage is n/a.

@dgageot dgageot merged commit 39a5664 into GoogleContainerTools:master Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestDevPortForward is flaky
3 participants