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

Conversation

Projects
None yet
5 participants
@ahmetb
Contributor

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))

This comment has been minimized.

@icecrime

icecrime Feb 12, 2015

Contributor

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)

This comment has been minimized.

@ahmetb

ahmetb Feb 12, 2015

Contributor

you're right, fixing now.

docker_api_attach_test: fix WS test to use DOCKER_TEST_HOST if specified
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 from docker_api_attach_test: fix WS test to use DOCKER_TEST_HOST if specified to TestGetContainersAttachWebsocket: fix WS test to use DOCKER_TEST_HOST if specified Feb 12, 2015

@ahmetb ahmetb changed the title from TestGetContainersAttachWebsocket: fix WS test to use DOCKER_TEST_HOST if specified to TestGetContainersAttachWebsocket: use DOCKER_TEST_HOST if specified Feb 12, 2015

@icecrime

This comment has been minimized.

Contributor

icecrime commented Feb 14, 2015

LGTM

@tianon

This comment has been minimized.

Member

tianon commented Feb 14, 2015

LGTM ❤️

@tianon

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Contributor

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

Arnaud Porterie
Merge pull request #10747 from ahmetalpbalkan/win-cli/TestContainersA…
…ttachWS-fix

TestGetContainersAttachWebsocket: use DOCKER_TEST_HOST if specified

@icecrime icecrime merged commit 38ca779 into moby:master Feb 16, 2015

1 check passed

janky Jenkins build Docker-PRs 980 has succeeded
Details

@tianon tianon removed the status/4-merge label Feb 16, 2015

@ahmetb ahmetb deleted the ahmetb:win-cli/TestContainersAttachWS-fix branch Feb 16, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment