Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(9795)

Issue 82940044: Make the test not use a fixed port.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years ago by thumper
Modified:
10 years ago
Reviewers:
axw, mp+213582
Visibility:
Public.

Description

Make the test not use a fixed port. Simple change to avoid a fixed port in the test. https://code.launchpad.net/~thumper/juju-core/client-test-no-fixed-port/+merge/213582 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 5

Patch Set 2 : Make the test not use a fixed port. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -3 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M state/api/client_test.go View 1 2 chunks +7 lines, -3 lines 0 comments Download

Messages

Total messages: 4
thumper
Please take a look.
10 years ago (2014-04-01 04:40:56 UTC) #1
axw
LGTM 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#newcode72 state/api/client_test.go:72: url := fmt.Sprintf("http://localhost:%d", port) This can be simplified ...
10 years ago (2014-04-01 04:47:19 UTC) #2
axw
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") Sorry, just realised: please ...
10 years ago (2014-04-01 04:48:36 UTC) #3
thumper
10 years ago (2014-04-01 05:45:36 UTC) #4
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#oldco...
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#newco...
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#newco...
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.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b