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

Issue 6496131: mstate: add machines watcher

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 7 months ago by aram
Modified:
11 years, 7 months ago
Reviewers:
mp+124711, niemeyer
Visibility:
Public.

Description

mstate: add machines watcher https://code.launchpad.net/~aramh/juju-core/71-mstate-watchers-machines-nwo/+merge/124711 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 9

Patch Set 2 : mstate: add machines watcher #

Patch Set 3 : mstate: add machines watcher #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+336 lines, -2 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M mstate/state_test.go View 1 2 chunks +186 lines, -0 lines 3 comments Download
M mstate/watcher.go View 1 2 2 chunks +148 lines, -2 lines 0 comments Download

Messages

Total messages: 6
aram
Please take a look.
11 years, 7 months ago (2012-09-17 15:15:26 UTC) #1
aram
Please take a look.
11 years, 7 months ago (2012-09-17 15:29:41 UTC) #2
niemeyer
https://codereview.appspot.com/6496131/diff/1/mstate/watcher.go File mstate/watcher.go (right): https://codereview.appspot.com/6496131/diff/1/mstate/watcher.go#newcode136 mstate/watcher.go:136: func (w *MachinesWatcher) appendChange(changes *MachinesChange, ch watcher.Change) (err error) ...
11 years, 7 months ago (2012-09-17 15:39:49 UTC) #3
aram
https://codereview.appspot.com/6496131/diff/1/mstate/watcher.go File mstate/watcher.go (right): https://codereview.appspot.com/6496131/diff/1/mstate/watcher.go#newcode136 mstate/watcher.go:136: func (w *MachinesWatcher) appendChange(changes *MachinesChange, ch watcher.Change) (err error) ...
11 years, 7 months ago (2012-09-17 16:02:54 UTC) #4
aram
*** Submitted: mstate: add machines watcher R=niemeyer CC= https://codereview.appspot.com/6496131
11 years, 7 months ago (2012-09-17 16:03:41 UTC) #5
niemeyer
11 years, 7 months ago (2012-09-17 16:16:56 UTC) #6
Pretty much ready. Just a trivial on the test and a question.

https://codereview.appspot.com/6496131/diff/5002/mstate/state_test.go
File mstate/state_test.go (right):

https://codereview.appspot.com/6496131/diff/5002/mstate/state_test.go#newcode217
mstate/state_test.go:217: // 0
Such indexes make it inconvenient to organize and add tests, for little gain. If
you want to make it more debuggable, the best way is having a "summary string"
field at the top of the struct, and adding inline comments describing what each
test is doing.

https://codereview.appspot.com/6496131/diff/5002/mstate/state_test.go#newcode347
mstate/state_test.go:347: if moreMachinesRequired(got, test.added, test.removed)
{
Given the use of StartSync above, I believe we can guarantee the semantics
without this. Does it break if you just assert below?

https://codereview.appspot.com/6496131/diff/5002/mstate/state_test.go#newcode382
mstate/state_test.go:382: c.Assert(len(got.Removed), Equals, len(removed))
Instead of doing this, I suggest building two sorted lists of []int, and
asserting one against the other. This gives us good debugging info when it
fails.
Sign in to reply to this message.

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