MCPcopy
hub / github.com/dropbox/godropbox / TestConnectTimeout

Method TestConnectTimeout

net2/http2/simple_pool_test.go:62–78  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

60}
61
62func (s *SimplePoolSuite) TestConnectTimeout(c *C) {
63 server, addr := test_utils.SetupTestServer(false)
64 defer server.Close()
65
66 params := ConnectionParams{
67 MaxIdle: 1,
68 ConnectTimeout: 1 * time.Nanosecond,
69 }
70 var pool Pool = NewSimplePool(addr, params)
71
72 req, err := http.NewRequest("GET", "/", nil)
73 c.Assert(err, IsNil)
74
75 _, err = pool.Do(req)
76 _, ok := err.(DialError)
77 c.Assert(ok, IsTrue)
78}
79
80func (s *SimplePoolSuite) TestResponseTimeout(c *C) {
81 server, addr := test_utils.SetupTestServer(false)

Callers

nothing calls this directly

Calls 4

DoMethod · 0.95
SetupTestServerFunction · 0.92
NewSimplePoolFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected