Code review comment for lp:~thumper/juju-core/client-test-no-fixed-port

Revision history for this message
Tim Penhey (thumper) wrote :

Please take a look.

https://codereview.appspot.com/82940044/diff/1/state/api/client_test.go
File state/api/client_test.go (left):

https://codereview.appspot.com/82940044/diff/1/state/api/client_test.go#oldcode75
state/api/client_test.go:75: c.Assert(err, gc.IsNil)
Had to remove the assert as it now returned a "use of closed connection"
error, and we don't actually care about the error.

https://codereview.appspot.com/82940044/diff/1/state/api/client_test.go
File state/api/client_test.go (right):

https://codereview.appspot.com/82940044/diff/1/state/api/client_test.go#newcode69
state/api/client_test.go:69: lis, err := net.Listen("tcp", ":0")
On 2014/04/01 04:48:36, axw wrote:
> Sorry, just realised: please defer lis.Close() after checking the
error.

ok

https://codereview.appspot.com/82940044/diff/1/state/api/client_test.go#newcode72
state/api/client_test.go:72: url := fmt.Sprintf("http://localhost:%d",
port)
On 2014/04/01 04:47:19, axw wrote:
> This can be simplified to:
> fmt.Sprintf("http://%s", lis.Addr())

Done.

https://codereview.appspot.com/82940044/

« Back to merge proposal