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

TestGetContainersAttachWebsocket: use DOCKER_TEST_HOST if specified #10747

Merged
merged 1 commit into from
Feb 16, 2015
Merged

TestGetContainersAttachWebsocket: use DOCKER_TEST_HOST if specified #10747

merged 1 commit into from
Feb 16, 2015

Conversation

ahmetb
Copy link
Contributor

@ahmetb ahmetb commented Feb 12, 2015

TestGetContainersAttachWebsocket is currently broken on Windows CI tests b/c it has hardcoded unix://var/run/docker.sock. (introduced in #10153.) This change makes use of @icecrime's code in docker_utils and generalizes it with sockConn() to provide a net.Conn by making use of DOCKER_TEST_HOST.

Also fixes the test TestGetContainersAttachWebsocket on windows/darwin.

Signed-off-by: Ahmet Alp Balkan ahmetalpbalkan@gmail.com
Label: #windows
Cc: @acbodine @tiborvass @icecrime @unclejack @jfrazelle

@@ -292,14 +283,27 @@ func sockRequestRaw(method, endpoint string, data io.Reader, ct string) ([]byte,
var c net.Conn
switch daemonUrl.Scheme {
case "unix":
c, err = net.DialTimeout(daemonUrl.Scheme, daemonUrl.Path, time.Duration(10*time.Second))
return net.DialTimeout(daemonUrl.Scheme, daemonUrl.Path, time.Duration(10*time.Second))
Copy link
Contributor

Choose a reason for hiding this comment

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

Am I missing something or we should be using the timeout parameter instead of the time.Duration(10*time.Second) hardcoded value here? (same issue in the case "tcp": below)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you're right, fixing now.

TestGetContainersAttachWebsocket is currently broken on Windows CI tests
b/c it has hardcoded unix://var/run/docker.sock.  This change makes use
of @icecrime's code in docker_utils and generalizes it with sockConn()
to provide a net.Conn by making use of DOCKER_TEST_HOST. Also fixes
the test.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
@ahmetb ahmetb changed the title docker_api_attach_test: fix WS test to use DOCKER_TEST_HOST if specified TestGetContainersAttachWebsocket: fix WS test to use DOCKER_TEST_HOST if specified Feb 12, 2015
@ahmetb ahmetb changed the title TestGetContainersAttachWebsocket: fix WS test to use DOCKER_TEST_HOST if specified TestGetContainersAttachWebsocket: use DOCKER_TEST_HOST if specified Feb 12, 2015
@icecrime
Copy link
Contributor

LGTM

@tianon
Copy link
Member

tianon commented Feb 14, 2015

LGTM ❤️

@tianon
Copy link
Member

tianon commented Feb 14, 2015

(So far in my test run, this is the only test that's failed when I supply a non-default DOCKER_HOST and --host to our daemon as I postulated that we ought to do in #10797 (comment).)

@tianon
Copy link
Member

tianon commented Feb 14, 2015

Got another offender!

--- FAIL: TestCliProxyDisableProxyUnixSock (0.01s)
    docker_cli_proxy_test.go:15: exit status 1 time="2015-02-14T11:00:21Z" level="fatal" msg="Get http:///var/run/docker.sock/v1.18/info: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?" 

Want to try collecting them all in this one PR, or shall I start opening new PRs for each? 😇

@ahmetb
Copy link
Contributor Author

ahmetb commented Feb 14, 2015

@tianon I think there's no need. It'd be just fine if you send PR for utils.fo#daemonHost().

This test was hardcoded to use unix sock. I'm fixing them as I go, no worries. 😄 🌃 😴

icecrime pushed a commit that referenced this pull request Feb 16, 2015
…ttachWS-fix

TestGetContainersAttachWebsocket: use DOCKER_TEST_HOST if specified
@icecrime icecrime merged commit 38ca779 into moby:master Feb 16, 2015
@ahmetb ahmetb deleted the win-cli/TestContainersAttachWS-fix branch February 16, 2015 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants