On Tuesday, April 18, 2017 at 8:19:06 AM UTC-7, Peter Mogensen wrote:
>
> > and even if one was 
> > still open, I'm making a new http.Client object, too! 
>
> Yes. But you don't make a new Transport. 
> Both your clients use DefaultTransport - which has the connection pool. 
>
> /Peter 
>
>
Bingo.  I think that's it, I didn't know there was a default global 
connection pool for http.Clients in the default transport.  It's definitely 
surprising, although I understand the motivation.

Since the server code is the code under test and the client code is part of 
the testing code, I think my answer here is to use a new transport for each 
test.  (It's just like any other test cleanup behavior I'd need to write.)

Thanks so much!

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to