dropbox/godropbox — pull request #65 by 4578395263256 (2014-08-13 22:03:28+00:00)
Title: Fix test TestConnectTimeout in net2/http2/simple_pool_test

The previous version of the test did not test timeout, because it would try to connect to a nonexistent address and thus always get a dial error.

This change sets up a test server, so that the connect will succeed (if there is no timeout). There is a slight risk that this will fail if the connect is really really fast, but that is highly unlikely to happen.

The go library's DialTimeout test is quite complicated: http://golang.org/src/pkg/net/dial_test.go
and this test should be good enough to check whether there is indeed a timeout or not. (If timeout isn't implemented correctly, this test indeed does fail)