HTTP returns a Go http.Client which has a default timeout of 10 seconds, and separate connection pool to the default allowing tests to be properly isolated when running in parallel. The returned client will call CloseIdleConnections on test cleanup.
(t assert.TestingT)
| 25 | // isolated when running in parallel. |
| 26 | // The returned client will call CloseIdleConnections on test cleanup. |
| 27 | func HTTP(t assert.TestingT) *http.Client { |
| 28 | return HTTPWithTimeout(t, time.Second*30) |
| 29 | } |
| 30 | |
| 31 | func HTTPWithTimeout(t assert.TestingT, timeout time.Duration) *http.Client { |
| 32 | client := &http.Client{ |