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

Delta Between Two Patch Sets: worker/provisioner/provisioner_test.go

Issue 6447054: state: implement MachineInfoWatcher
Left Patch Set: state: implement MachineInfoWatcher Created 11 years, 8 months ago
Right Patch Set: state: implement MachineInfoWatcher Created 11 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « worker/provisioner/provisioner.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 package provisioner_test 1 package provisioner_test
2 2
3 import ( 3 import (
4 "time" 4 "time"
5 5
6 . "launchpad.net/gocheck" 6 . "launchpad.net/gocheck"
7 "launchpad.net/juju-core/environs" 7 "launchpad.net/juju-core/environs"
8 "launchpad.net/juju-core/environs/dummy" 8 "launchpad.net/juju-core/environs/dummy"
9 "launchpad.net/juju-core/state" 9 "launchpad.net/juju-core/state"
10 "launchpad.net/juju-core/state/testing" 10 "launchpad.net/juju-core/state/testing"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // that matches that of the given instance. If the instance is nil, 155 // that matches that of the given instance. If the instance is nil,
156 // It checks that the instance id is unset. 156 // It checks that the instance id is unset.
157 func (s *ProvisionerSuite) checkMachineId(c *C, m *state.Machine, inst environs. Instance) { 157 func (s *ProvisionerSuite) checkMachineId(c *C, m *state.Machine, inst environs. Instance) {
158 // TODO(dfc) add machine.WatchConfig() to avoid having to poll. 158 // TODO(dfc) add machine.WatchConfig() to avoid having to poll.
159 instId := "" 159 instId := ""
160 if inst != nil { 160 if inst != nil {
161 instId = inst.Id() 161 instId = inst.Id()
162 } 162 }
163 for a := veryShortAttempt.Start(); a.Next(); { 163 for a := veryShortAttempt.Start(); a.Next(); {
164 _, err := m.InstanceId() 164 _, err := m.InstanceId()
165 » » _, notset := err.(*state.NoInstanceIdError) 165 » » _, notset := err.(*state.NotFoundError)
166 if notset { 166 if notset {
167 if inst == nil { 167 if inst == nil {
168 return 168 return
169 } else { 169 } else {
170 continue 170 continue
171 } 171 }
172 } 172 }
173 c.Assert(err, IsNil) 173 c.Assert(err, IsNil)
174 break 174 break
175 } 175 }
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 err = s.fixEnvironment() 411 err = s.fixEnvironment()
412 c.Assert(err, IsNil) 412 c.Assert(err, IsNil)
413 413
414 // create a third machine 414 // create a third machine
415 m, err = s.State.AddMachine() 415 m, err = s.State.AddMachine()
416 c.Assert(err, IsNil) 416 c.Assert(err, IsNil)
417 417
418 // the PA should create it using the new environment 418 // the PA should create it using the new environment
419 s.checkStartInstance(c, m) 419 s.checkStartInstance(c, m)
420 } 420 }
LEFTRIGHT

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