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

Issue 7616044: state: Test Destroy() better, small fix. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 1 month ago by dimitern
Modified:
13 years, 1 month ago
Reviewers:
mp+152477, jameinel
Visibility:
Public.

Description

state: Test Destroy() better, small fix. We weren't testing the service.Destroy() behavior separately and since we encountered an issue with the API tests when service is not destroyed properly, here are more specific tests. Also a small issue was fixed in Destory()'s defer func. https://code.launchpad.net/~dimitern/juju-core/011-fix-state-service-destroy/+merge/152477 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 3

Patch Set 2 : state: Test Destroy() better, small fix. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -1 line) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M state/service.go View 1 chunk +1 line, -1 line 0 comments Download
M state/service_test.go View 1 1 chunk +25 lines, -0 lines 2 comments Download

Messages

Total messages: 6
dimitern
Please take a look.
13 years, 1 month ago (2013-03-08 17:59:28 UTC) #1
gz
LGTM https://codereview.appspot.com/7616044/diff/1/state/service.go File state/service.go (right): https://codereview.appspot.com/7616044/diff/1/state/service.go#newcode78 state/service.go:78: if err == nil { I got William ...
13 years, 1 month ago (2013-03-08 19:52:07 UTC) #2
fwereade
LGTM https://codereview.appspot.com/7616044/diff/1/state/service_test.go File state/service_test.go (right): https://codereview.appspot.com/7616044/diff/1/state/service_test.go#newcode445 state/service_test.go:445: func (s *ServiceSuite) TestDestroyHaveNoUnits(c *C) { s/HaveNoUnits/OnceHadUnits/
13 years, 1 month ago (2013-03-08 19:53:30 UTC) #3
dimitern
*** Submitted: state: Test Destroy() better, small fix. We weren't testing the service.Destroy() behavior separately ...
13 years, 1 month ago (2013-03-08 20:02:57 UTC) #4
jameinel
LGTM https://codereview.appspot.com/7616044/diff/7001/state/service_test.go File state/service_test.go (right): https://codereview.appspot.com/7616044/diff/7001/state/service_test.go#newcode457 state/service_test.go:457: c.Assert(s.mysql.Life(), Equals, state.Dying) Would you want to assert ...
13 years, 1 month ago (2013-03-08 20:29:48 UTC) #5
dimitern
13 years, 1 month ago (2013-03-08 20:52:44 UTC) #6
Message was sent while issue was closed.
https://codereview.appspot.com/7616044/diff/7001/state/service_test.go
File state/service_test.go (right):

https://codereview.appspot.com/7616044/diff/7001/state/service_test.go#newcod...
state/service_test.go:457: c.Assert(s.mysql.Life(), Equals, state.Dying)
On 2013/03/08 20:29:48, jameinel wrote:
> Would you want to assert that s.mysql.Life() is *not* state.Dying before you
> call Destroy? (Then you are asserting that it transitioned from something to
> something.)
> 
> Just a thought.

It'll either be Alive or it won't exist. Destroy() does not care if it's already
dying. And anyway - we start with the case that it's Alive anyway, so I don't
think we need to check it here. There are other Life() tests who do that.
Sign in to reply to this message.

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