Merge lp:~wallyworld/juju-core/instance-poller-noise into lp:~go-bot/juju-core/trunk

Proposed by Ian Booth
Status: Merged
Approved by: Ian Booth
Approved revision: no longer in the source branch.
Merged at revision: 2589
Proposed branch: lp:~wallyworld/juju-core/instance-poller-noise
Merge into: lp:~go-bot/juju-core/trunk
Diff against target: 245 lines (+101/-14)
3 files modified
worker/instancepoller/machine_test.go (+29/-9)
worker/instancepoller/updater.go (+20/-5)
worker/instancepoller/updater_test.go (+52/-0)
To merge this branch: bzr merge lp:~wallyworld/juju-core/instance-poller-noise
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+214857@code.launchpad.net

Commit message

Noisy instance poller

The instance poller was trying to poll instances which
are not yet provisioned, as well as manual instances, creating lots of log noise.
This fixes that.

https://codereview.appspot.com/85770043/

Description of the change

Noisy instance poller

The instance poller was trying to poll instances which
are not yet provisioned, as well as manual instances, creating lots of log noise.
This fixes that.

https://codereview.appspot.com/85770043/

To post a comment you must log in.
Revision history for this message
Ian Booth (wallyworld) wrote :
Download full text (5.5 KiB)

Reviewers: mp+214857_code.launchpad.net,

Message:
Please take a look.

Description:
Noisy instance poller

The instance poller was trying to poll instances which
are not yet provisioned, creating lots of log noise.
This fixes that.

https://code.launchpad.net/~wallyworld/juju-core/instance-poller-noise/+merge/214857

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/85770043/

Affected files (+25, -9 lines):
   A [revision details]
   M worker/instancepoller/machine_test.go
   M worker/instancepoller/updater.go

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-20140408170048-h58307lijtftb3su
+New revision: <email address hidden>

Index: worker/instancepoller/machine_test.go
=== modified file 'worker/instancepoller/machine_test.go'
--- worker/instancepoller/machine_test.go 2014-04-01 23:56:19 +0000
+++ worker/instancepoller/machine_test.go 2014-04-09 00:14:53 +0000
@@ -61,24 +61,31 @@
  func (s *machineSuite) TestShortPollIntervalWhenNoAddress(c *gc.C) {
   s.PatchValue(&ShortPoll, 1*time.Millisecond)
   s.PatchValue(&LongPoll, coretesting.LongWait)
- count := countPolls(c, nil, "running", params.StatusStarted)
+ count := countPolls(c, nil, "i1234", "running", params.StatusStarted)
   c.Assert(count, jc.GreaterThan, 2)
  }

  func (s *machineSuite) TestShortPollIntervalWhenNoStatus(c *gc.C) {
   s.PatchValue(&ShortPoll, 1*time.Millisecond)
   s.PatchValue(&LongPoll, coretesting.LongWait)
- count := countPolls(c, testAddrs, "", params.StatusStarted)
+ count := countPolls(c, testAddrs, "i1234", "", params.StatusStarted)
   c.Assert(count, jc.GreaterThan, 2)
  }

  func (s *machineSuite) TestShortPollIntervalWhenNotStarted(c *gc.C) {
   s.PatchValue(&ShortPoll, 1*time.Millisecond)
   s.PatchValue(&LongPoll, coretesting.LongWait)
- count := countPolls(c, testAddrs, "pending", params.StatusPending)
+ count := countPolls(c, testAddrs, "i1234", "pending",
params.StatusPending)
   c.Assert(count, jc.GreaterThan, 2)
  }

+func (s *machineSuite) TestShortPollIntervalWhenNotProvisioned(c *gc.C) {
+ s.PatchValue(&ShortPoll, 1*time.Millisecond)
+ s.PatchValue(&LongPoll, coretesting.LongWait)
+ count := countPolls(c, testAddrs, "", "pending", params.StatusPending)
+ c.Assert(count, gc.Equals, 0)
+}
+
  func (s *machineSuite) TestShortPollIntervalExponent(c *gc.C) {
   s.PatchValue(&ShortPoll, 1*time.Microsecond)
   s.PatchValue(&LongPoll, coretesting.LongWait)
@@ -89,7 +96,7 @@
   // ShortPollBackoff of ShortWait/ShortPoll, given that sleep will
   // sleep for at least the requested interval.
   maxCount :=
int(math.Log(float64(coretesting.ShortWait)/float64(ShortPoll))/math.Log(ShortPollBackoff)
+ 1)
- count := countPolls(c, nil, "", params.StatusStarted)
+ count := countPolls(c, nil, "i1234", "", params.StatusStarted)
   c.Assert(count, jc.GreaterThan, 2)
   c.Assert(count, jc.LessThan, maxCount)
   c.Logf("actual count: %v; max %v", count, maxCount)
@@ -98,7 +105,7 @@
  func (s *machineSuite) TestLongPollIntervalWh...

Read more...

Revision history for this message
Dave Cheney (dave-cheney) wrote :
Download full text (6.5 KiB)

LGTM. Thanks

On Wed, Apr 9, 2014 at 10:24 AM, Ian Booth <email address hidden> wrote:
> Reviewers: mp+214857_code.launchpad.net,
>
> Message:
> Please take a look.
>
> Description:
> Noisy instance poller
>
> The instance poller was trying to poll instances which
> are not yet provisioned, creating lots of log noise.
> This fixes that.
>
> https://code.launchpad.net/~wallyworld/juju-core/instance-poller-noise/+merge/214857
>
> (do not edit description out of merge proposal)
>
>
> Please review this at https://codereview.appspot.com/85770043/
>
> Affected files (+25, -9 lines):
> A [revision details]
> M worker/instancepoller/machine_test.go
> M worker/instancepoller/updater.go
>
>
> Index: [revision details]
> === added file '[revision details]'
> --- [revision details] 2012-01-01 00:00:00 +0000
> +++ [revision details] 2012-01-01 00:00:00 +0000
> @@ -0,0 +1,2 @@
> +Old revision: tarmac-20140408170048-h58307lijtftb3su
> +New revision: <email address hidden>
>
> Index: worker/instancepoller/machine_test.go
> === modified file 'worker/instancepoller/machine_test.go'
> --- worker/instancepoller/machine_test.go 2014-04-01 23:56:19 +0000
> +++ worker/instancepoller/machine_test.go 2014-04-09 00:14:53 +0000
> @@ -61,24 +61,31 @@
> func (s *machineSuite) TestShortPollIntervalWhenNoAddress(c *gc.C) {
> s.PatchValue(&ShortPoll, 1*time.Millisecond)
> s.PatchValue(&LongPoll, coretesting.LongWait)
> - count := countPolls(c, nil, "running", params.StatusStarted)
> + count := countPolls(c, nil, "i1234", "running", params.StatusStarted)
> c.Assert(count, jc.GreaterThan, 2)
> }
>
> func (s *machineSuite) TestShortPollIntervalWhenNoStatus(c *gc.C) {
> s.PatchValue(&ShortPoll, 1*time.Millisecond)
> s.PatchValue(&LongPoll, coretesting.LongWait)
> - count := countPolls(c, testAddrs, "", params.StatusStarted)
> + count := countPolls(c, testAddrs, "i1234", "", params.StatusStarted)
> c.Assert(count, jc.GreaterThan, 2)
> }
>
> func (s *machineSuite) TestShortPollIntervalWhenNotStarted(c *gc.C) {
> s.PatchValue(&ShortPoll, 1*time.Millisecond)
> s.PatchValue(&LongPoll, coretesting.LongWait)
> - count := countPolls(c, testAddrs, "pending", params.StatusPending)
> + count := countPolls(c, testAddrs, "i1234", "pending",
> params.StatusPending)
> c.Assert(count, jc.GreaterThan, 2)
> }
>
> +func (s *machineSuite) TestShortPollIntervalWhenNotProvisioned(c *gc.C) {
> + s.PatchValue(&ShortPoll, 1*time.Millisecond)
> + s.PatchValue(&LongPoll, coretesting.LongWait)
> + count := countPolls(c, testAddrs, "", "pending", params.StatusPending)
> + c.Assert(count, gc.Equals, 0)
> +}
> +
> func (s *machineSuite) TestShortPollIntervalExponent(c *gc.C) {
> s.PatchValue(&ShortPoll, 1*time.Microsecond)
> s.PatchValue(&LongPoll, coretesting.LongWait)
> @@ -89,7 +96,7 @@
> // ShortPollBackoff of ShortWait/ShortPoll, given that sleep will
> // sleep for at least the requested interval.
> maxCount :=
> int(math.Log(float64(coretesting.ShortWait)/floa...

Read more...

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Yay, LGTM. Just one thought below...

https://codereview.appspot.com/85770043/diff/1/worker/instancepoller/updater.go
File worker/instancepoller/updater.go (right):

https://codereview.appspot.com/85770043/diff/1/worker/instancepoller/updater.go#newcode188
worker/instancepoller/updater.go:188: machineStatus, _, _, err :=
m.Status()
This Status() call should be avoided if the instance isn't provisioned,
I think?

https://codereview.appspot.com/85770043/

Revision history for this message
Ian Booth (wallyworld) wrote :
Revision history for this message
Ian Booth (wallyworld) wrote :

On 2014/04/09 01:12:04, axw wrote:
> Yay, LGTM. Just one thought below...

https://codereview.appspot.com/85770043/diff/1/worker/instancepoller/updater.go
> File worker/instancepoller/updater.go (right):

https://codereview.appspot.com/85770043/diff/1/worker/instancepoller/updater.go#newcode188
> worker/instancepoller/updater.go:188: machineStatus, _, _, err :=
m.Status()
> This Status() call should be avoided if the instance isn't
provisioned, I think?

Yeah, I thought about it but then didn't want to duplicate the poll
interval backoff line. But I'll tweak it as it's best not not make an
unnecessary call.

https://codereview.appspot.com/85770043/

Revision history for this message
Ian Booth (wallyworld) wrote :
Revision history for this message
Go Bot (go-bot) wrote :
Download full text (24.9 KiB)

The attempt to merge lp:~wallyworld/juju-core/instance-poller-noise into lp:juju-core failed. Below is the output from the failed tests.

ok launchpad.net/juju-core 0.014s
ok launchpad.net/juju-core/agent 1.183s
ok launchpad.net/juju-core/agent/mongo 0.265s
ok launchpad.net/juju-core/agent/tools 0.200s
ok launchpad.net/juju-core/bzr 5.345s
ok launchpad.net/juju-core/cert 2.503s
ok launchpad.net/juju-core/charm 0.422s
? launchpad.net/juju-core/charm/hooks [no test files]
? launchpad.net/juju-core/charm/testing [no test files]
ok launchpad.net/juju-core/cloudinit 0.031s
ok launchpad.net/juju-core/cloudinit/sshinit 0.832s
ok launchpad.net/juju-core/cmd 0.167s
ok launchpad.net/juju-core/cmd/charm-admin 0.745s
? launchpad.net/juju-core/cmd/charmd [no test files]
? launchpad.net/juju-core/cmd/charmload [no test files]
ok launchpad.net/juju-core/cmd/envcmd 0.228s
ok launchpad.net/juju-core/cmd/juju 215.442s
panic: test timed out

goroutine 4583 [running]:
testing.alarm()
 /usr/lib/go/src/pkg/testing/testing.go:533 +0x53
created by time.goFunc
 /usr/lib/go/src/pkg/time/sleep.go:122 +0x48

goroutine 1 [chan receive]:
testing.RunTests(0x1094898, 0x170e300, 0x2, 0x2, 0xe1fb01, ...)
 /usr/lib/go/src/pkg/testing/testing.go:434 +0x88e
testing.Main(0x1094898, 0x170e300, 0x2, 0x2, 0x171ad00, ...)
 /usr/lib/go/src/pkg/testing/testing.go:365 +0x8a
main.main()
 launchpad.net/juju-core/cmd/jujud/_test/_testmain.go:45 +0x9a

goroutine 2 [syscall]:

goroutine 4 [syscall]:
os/signal.loop()
 /usr/lib/go/src/pkg/os/signal/signal_unix.go:21 +0x1c
created by os/signal.init·1
 /usr/lib/go/src/pkg/os/signal/signal_unix.go:27 +0x2f

goroutine 6 [chan receive]:
launchpad.net/juju-core/provider/dummy.func·001()
 /home/tarmac/trees/src/launchpad.net/juju-core/provider/dummy/environs.go:208 +0x3a
created by launchpad.net/juju-core/provider/dummy.init·1
 /home/tarmac/trees/src/launchpad.net/juju-core/provider/dummy/environs.go:210 +0xcf

goroutine 9 [chan receive]:
launchpad.net/gocheck.(*suiteRunner).runTest(0xc200239770, 0xc200237540, 0xc2008da500)
 /home/tarmac/trees/src/launchpad.net/gocheck/gocheck.go:771 +0x4f
launchpad.net/gocheck.(*suiteRunner).run(0xc200239770, 0xc200400600)
 /home/tarmac/trees/src/launchpad.net/gocheck/gocheck.go:584 +0x1c5
launchpad.net/gocheck.Run(0xeae6e0, 0xc200400600, 0xc2003c45c0, 0xc20022bc80)
 /home/tarmac/trees/src/launchpad.net/gocheck/run.go:76 +0x47
launchpad.net/gocheck.RunAll(0xc2003c45c0, 0xc2003c45c0)
 /home/tarmac/trees/src/launchpad.net/gocheck/run.go:68 +0xc2
launchpad.net/gocheck.TestingT(0xc2001ece10)
 /home/tarmac/trees/src/launchpad.net/gocheck/run.go:56 +0x2a2
launchpad.net/juju-core/testing.MgoTestPackageSsl(0xc2001ece10, 0x1)
 /home/tarmac/trees/src/launchpad.net/juju-core/testing/mgo.go:217 +0xef
launchpad.net/juju-core/testing.MgoTestPackage(0xc2001ece10)
 /home/tarmac/trees/src/launchpad.net/juju-core/testing/mgo.go:209 +0x2a
launchpad.net/juju-core/cmd/jujud.TestPackage(0xc2001ece10)
 /home/tarmac/trees/src/launchpad.net/juju-core/cmd/jujud/main_test.go:70 +0x184
testing.tRunner(0xc2001ece10, 0x170e300)
 /usr/lib/go/src/pkg/testing/testing.go:353 +0x8a
created by testing.RunTests
 /u...

Revision history for this message
Go Bot (go-bot) wrote :
Download full text (94.3 KiB)

The attempt to merge lp:~wallyworld/juju-core/instance-poller-noise into lp:juju-core failed. Below is the output from the failed tests.

ok launchpad.net/juju-core 0.012s
ok launchpad.net/juju-core/agent 1.125s
ok launchpad.net/juju-core/agent/mongo 0.367s
ok launchpad.net/juju-core/agent/tools 0.185s
ok launchpad.net/juju-core/bzr 5.059s
ok launchpad.net/juju-core/cert 2.725s
ok launchpad.net/juju-core/charm 0.376s
? launchpad.net/juju-core/charm/hooks [no test files]
? launchpad.net/juju-core/charm/testing [no test files]
ok launchpad.net/juju-core/cloudinit 0.030s
ok launchpad.net/juju-core/cloudinit/sshinit 0.934s
ok launchpad.net/juju-core/cmd 0.197s
ok launchpad.net/juju-core/cmd/charm-admin 0.739s
? launchpad.net/juju-core/cmd/charmd [no test files]
? launchpad.net/juju-core/cmd/charmload [no test files]
ok launchpad.net/juju-core/cmd/envcmd 0.202s
ok launchpad.net/juju-core/cmd/juju 212.727s

----------------------------------------------------------------------
PANIC: agent.go:0: MachineSuite.SetUpTest

[LOG] 93.14301 DEBUG juju.environs.configstore Making /tmp/jctest.Mot/gocheck-8674665223082153551/73/home/ubuntu/.juju/environments
[LOG] 93.21764 INFO juju environs/testing: uploading FAKE tools 1.19.0-precise-amd64
[LOG] 93.21830 INFO juju environs/testing: uploading FAKE tools 1.19.0-precise-amd64
[LOG] 93.22409 INFO juju environs/testing: uploading FAKE tools 1.19.0-precise-amd64
[LOG] 93.22514 DEBUG juju.environs.tools no architecture specified when finding tools, looking for any
[LOG] 93.22515 DEBUG juju.environs.tools no series specified when finding tools, looking for any
[LOG] 93.22522 DEBUG juju.environs.simplestreams fetchData failed for "tools/streams/v1/index.sjson": file "tools/streams/v1/index.sjson" not found not found
[LOG] 93.22527 DEBUG juju.environs.simplestreams cannot load index "streams/v1/index.sjson": invalid URL "tools/streams/v1/index.sjson" not found
[LOG] 93.22529 DEBUG juju.environs.simplestreams fetchData failed for "tools/streams/v1/index.json": file "tools/streams/v1/index.json" not found not found
[LOG] 93.22531 DEBUG juju.environs.simplestreams cannot load index "streams/v1/index.json": invalid URL "tools/streams/v1/index.json" not found
[LOG] 93.22572 INFO juju.environs.tools Writing tools/streams/v1/index.json
[LOG] 93.22576 INFO juju.environs.tools Writing tools/streams/v1/com.ubuntu.juju:released:tools.json
[LOG] 93.22585 DEBUG juju.environs.bootstrap environment "dummyenv" supports service/machine networks: true
[LOG] 93.22586 INFO juju.environs.bootstrap bootstrapping environment "dummyenv"
[LOG] 93.22590 DEBUG juju.environs.bootstrap looking for bootstrap tools: series="precise", arch=<nil>, version=1.19.0
[LOG] 93.22592 INFO juju.environs.tools reading tools with major.minor version 1.19
[LOG] 93.22593 INFO juju.environs.tools filtering tools by version: 1.19.0
[LOG] 93.22594 INFO juju.environs.tools filtering tools by series: precise
[LOG] 93.22595 DEBUG juju.environs.tools no architecture specified when finding tools, looking for any
[LOG] 93.22598 DEBUG juju.environs.simplestreams fetchData failed for "tools/streams/v1/index.sjson": file "tools/stream...

Revision history for this message
Go Bot (go-bot) wrote :
Download full text (168.4 KiB)

The attempt to merge lp:~wallyworld/juju-core/instance-poller-noise into lp:juju-core failed. Below is the output from the failed tests.

ok launchpad.net/juju-core 0.014s
ok launchpad.net/juju-core/agent 1.110s
ok launchpad.net/juju-core/agent/mongo 0.276s
ok launchpad.net/juju-core/agent/tools 0.196s
ok launchpad.net/juju-core/bzr 5.055s
ok launchpad.net/juju-core/cert 2.271s
ok launchpad.net/juju-core/charm 0.351s
? launchpad.net/juju-core/charm/hooks [no test files]
? launchpad.net/juju-core/charm/testing [no test files]
ok launchpad.net/juju-core/cloudinit 0.029s
ok launchpad.net/juju-core/cloudinit/sshinit 0.758s
ok launchpad.net/juju-core/cmd 0.171s
ok launchpad.net/juju-core/cmd/charm-admin 0.716s
? launchpad.net/juju-core/cmd/charmd [no test files]
? launchpad.net/juju-core/cmd/charmload [no test files]
ok launchpad.net/juju-core/cmd/envcmd 0.141s
ok launchpad.net/juju-core/cmd/juju 213.353s
panic: Session already closed

goroutine 2007 [running]:
labix.org/v2/mgo.(*Session).cluster(0xc2006df000, 0x0)
 /home/tarmac/trees/src/labix.org/v2/mgo/session.go:1037 +0x64
labix.org/v2/mgo.(*Session).acquireSocket(0xc2006df000, 0xc200000001, 0x0, 0x0, 0x0, ...)
 /home/tarmac/trees/src/labix.org/v2/mgo/session.go:3099 +0x212
labix.org/v2/mgo.(*Query).Iter(0xc200a01380, 0x7f370c0d5e78)
 /home/tarmac/trees/src/labix.org/v2/mgo/session.go:2249 +0x18a
launchpad.net/juju-core/state/watcher.(*Watcher).sync(0xc2007cbea0, 0xc2008692a0, 0x7f370c0d5f70)
 /home/tarmac/trees/src/launchpad.net/juju-core/state/watcher/watcher.go:350 +0xe8
launchpad.net/juju-core/state/watcher.(*Watcher).loop(0xc2007cbea0, 0x0, 0xc200b5f9e0)
 /home/tarmac/trees/src/launchpad.net/juju-core/state/watcher/watcher.go:220 +0x87
launchpad.net/juju-core/state/watcher.func·001()
 /home/tarmac/trees/src/launchpad.net/juju-core/state/watcher/watcher.go:118 +0x2c
created by launchpad.net/juju-core/state/watcher.New
 /home/tarmac/trees/src/launchpad.net/juju-core/state/watcher/watcher.go:120 +0x100

goroutine 1 [chan receive]:
testing.RunTests(0x1094898, 0x170e300, 0x2, 0x2, 0xe1fb01, ...)
 /usr/lib/go/src/pkg/testing/testing.go:434 +0x88e
testing.Main(0x1094898, 0x170e300, 0x2, 0x2, 0x171ad00, ...)
 /usr/lib/go/src/pkg/testing/testing.go:365 +0x8a
main.main()
 launchpad.net/juju-core/cmd/jujud/_test/_testmain.go:45 +0x9a

goroutine 2 [syscall]:

goroutine 4 [syscall]:
os/signal.loop()
 /usr/lib/go/src/pkg/os/signal/signal_unix.go:21 +0x1c
created by os/signal.init·1
 /usr/lib/go/src/pkg/os/signal/signal_unix.go:27 +0x2f

goroutine 6 [chan receive]:
launchpad.net/juju-core/provider/dummy.func·001()
 /home/tarmac/trees/src/launchpad.net/juju-core/provider/dummy/environs.go:208 +0x3a
created by launchpad.net/juju-core/provider/dummy.init·1
 /home/tarmac/trees/src/launchpad.net/juju-core/provider/dummy/environs.go:210 +0xcf

goroutine 9 [chan receive]:
launchpad.net/gocheck.(*suiteRunner).runTest(0xc200236cb0, 0xc20022dd90, 0xc2004d3460)
 /home/tarmac/trees/src/launchpad.net/gocheck/gocheck.go:771 +0x4f
launchpad.net/gocheck.(*suiteRunner).run(0xc200236cb0, 0xc20042f600)
 /home/tarmac/trees/src/launchpad.net/gocheck/gocheck.go:584 +0x1c5
launchpad.net/g...

Revision history for this message
Go Bot (go-bot) wrote :
Download full text (22.2 KiB)

The attempt to merge lp:~wallyworld/juju-core/instance-poller-noise into lp:juju-core failed. Below is the output from the failed tests.

ok launchpad.net/juju-core 0.014s
ok launchpad.net/juju-core/agent 1.089s
ok launchpad.net/juju-core/agent/mongo 0.289s
ok launchpad.net/juju-core/agent/tools 0.192s
ok launchpad.net/juju-core/bzr 5.094s
ok launchpad.net/juju-core/cert 2.551s
ok launchpad.net/juju-core/charm 0.384s
? launchpad.net/juju-core/charm/hooks [no test files]
? launchpad.net/juju-core/charm/testing [no test files]
ok launchpad.net/juju-core/cloudinit 0.029s
ok launchpad.net/juju-core/cloudinit/sshinit 0.922s
ok launchpad.net/juju-core/cmd 0.184s
ok launchpad.net/juju-core/cmd/charm-admin 0.716s
? launchpad.net/juju-core/cmd/charmd [no test files]
? launchpad.net/juju-core/cmd/charmload [no test files]
ok launchpad.net/juju-core/cmd/envcmd 0.200s
ok launchpad.net/juju-core/cmd/juju 213.199s

----------------------------------------------------------------------
PANIC: agent.go:0: MachineSuite.SetUpTest

[LOG] 15.07518 DEBUG juju.environs.configstore Making /tmp/jctest.cSn/gocheck-8674665223082153551/65/home/ubuntu/.juju/environments
[LOG] 15.15141 INFO juju environs/testing: uploading FAKE tools 1.19.0-precise-amd64
[LOG] 15.16909 INFO juju environs/testing: uploading FAKE tools 1.19.0-precise-amd64
[LOG] 15.16960 INFO juju environs/testing: uploading FAKE tools 1.19.0-precise-amd64
[LOG] 15.17008 DEBUG juju.environs.tools no architecture specified when finding tools, looking for any
[LOG] 15.17009 DEBUG juju.environs.tools no series specified when finding tools, looking for any
[LOG] 15.17013 DEBUG juju.environs.simplestreams fetchData failed for "tools/streams/v1/index.sjson": file "tools/streams/v1/index.sjson" not found not found
[LOG] 15.17015 DEBUG juju.environs.simplestreams cannot load index "streams/v1/index.sjson": invalid URL "tools/streams/v1/index.sjson" not found
[LOG] 15.17017 DEBUG juju.environs.simplestreams fetchData failed for "tools/streams/v1/index.json": file "tools/streams/v1/index.json" not found not found
[LOG] 15.17019 DEBUG juju.environs.simplestreams cannot load index "streams/v1/index.json": invalid URL "tools/streams/v1/index.json" not found
[LOG] 15.17040 INFO juju.environs.tools Writing tools/streams/v1/index.json
[LOG] 15.17042 INFO juju.environs.tools Writing tools/streams/v1/com.ubuntu.juju:released:tools.json
[LOG] 15.17046 DEBUG juju.environs.bootstrap environment "dummyenv" supports service/machine networks: true
[LOG] 15.17046 INFO juju.environs.bootstrap bootstrapping environment "dummyenv"
[LOG] 15.17049 DEBUG juju.environs.bootstrap looking for bootstrap tools: series="precise", arch=<nil>, version=1.19.0
[LOG] 15.17050 INFO juju.environs.tools reading tools with major.minor version 1.19
[LOG] 15.17051 INFO juju.environs.tools filtering tools by version: 1.19.0
[LOG] 15.17052 INFO juju.environs.tools filtering tools by series: precise
[LOG] 15.17053 DEBUG juju.environs.tools no architecture specified when finding tools, looking for any
[LOG] 15.17055 DEBUG juju.environs.simplestreams fetchData failed for "tools/streams/v1/index.sjson": file "tools/stream...

Revision history for this message
Go Bot (go-bot) wrote :
Download full text (168.8 KiB)

The attempt to merge lp:~wallyworld/juju-core/instance-poller-noise into lp:juju-core failed. Below is the output from the failed tests.

ok launchpad.net/juju-core 0.014s
ok launchpad.net/juju-core/agent 1.130s
ok launchpad.net/juju-core/agent/mongo 0.382s
ok launchpad.net/juju-core/agent/tools 0.252s
ok launchpad.net/juju-core/bzr 5.220s
ok launchpad.net/juju-core/cert 2.701s
ok launchpad.net/juju-core/charm 0.438s
? launchpad.net/juju-core/charm/hooks [no test files]
? launchpad.net/juju-core/charm/testing [no test files]
ok launchpad.net/juju-core/cloudinit 0.034s
ok launchpad.net/juju-core/cloudinit/sshinit 0.752s
ok launchpad.net/juju-core/cmd 0.185s
ok launchpad.net/juju-core/cmd/charm-admin 0.741s
? launchpad.net/juju-core/cmd/charmd [no test files]
? launchpad.net/juju-core/cmd/charmload [no test files]
ok launchpad.net/juju-core/cmd/envcmd 0.197s
ok launchpad.net/juju-core/cmd/juju 214.166s
panic: Session already closed

goroutine 2006 [running]:
labix.org/v2/mgo.(*Session).cluster(0xc200bb0c60, 0x0)
 /home/tarmac/trees/src/labix.org/v2/mgo/session.go:1037 +0x64
labix.org/v2/mgo.(*Session).acquireSocket(0xc200bb0c60, 0xc200000001, 0x0, 0x0, 0x0, ...)
 /home/tarmac/trees/src/labix.org/v2/mgo/session.go:3099 +0x212
labix.org/v2/mgo.(*Query).Iter(0xc2002851c0, 0x7f13d5bf1e78)
 /home/tarmac/trees/src/labix.org/v2/mgo/session.go:2249 +0x18a
launchpad.net/juju-core/state/watcher.(*Watcher).sync(0xc200c502d0, 0xc20034a1c0, 0x7f13d5bf1f70)
 /home/tarmac/trees/src/launchpad.net/juju-core/state/watcher/watcher.go:350 +0xe8
launchpad.net/juju-core/state/watcher.(*Watcher).loop(0xc200c502d0, 0x0, 0xc200958d20)
 /home/tarmac/trees/src/launchpad.net/juju-core/state/watcher/watcher.go:220 +0x87
launchpad.net/juju-core/state/watcher.func·001()
 /home/tarmac/trees/src/launchpad.net/juju-core/state/watcher/watcher.go:118 +0x2c
created by launchpad.net/juju-core/state/watcher.New
 /home/tarmac/trees/src/launchpad.net/juju-core/state/watcher/watcher.go:120 +0x100

goroutine 1 [chan receive]:
testing.RunTests(0x1094898, 0x170e300, 0x2, 0x2, 0xe1fb01, ...)
 /usr/lib/go/src/pkg/testing/testing.go:434 +0x88e
testing.Main(0x1094898, 0x170e300, 0x2, 0x2, 0x171ad00, ...)
 /usr/lib/go/src/pkg/testing/testing.go:365 +0x8a
main.main()
 launchpad.net/juju-core/cmd/jujud/_test/_testmain.go:45 +0x9a

goroutine 2 [syscall]:

goroutine 4 [syscall]:
os/signal.loop()
 /usr/lib/go/src/pkg/os/signal/signal_unix.go:21 +0x1c
created by os/signal.init·1
 /usr/lib/go/src/pkg/os/signal/signal_unix.go:27 +0x2f

goroutine 6 [chan receive]:
launchpad.net/juju-core/provider/dummy.func·001()
 /home/tarmac/trees/src/launchpad.net/juju-core/provider/dummy/environs.go:208 +0x3a
created by launchpad.net/juju-core/provider/dummy.init·1
 /home/tarmac/trees/src/launchpad.net/juju-core/provider/dummy/environs.go:210 +0xcf

goroutine 9 [chan receive]:
launchpad.net/gocheck.(*suiteRunner).runTest(0xc20041c000, 0xc20041cf50, 0xc200927dc0)
 /home/tarmac/trees/src/launchpad.net/gocheck/gocheck.go:771 +0x4f
launchpad.net/gocheck.(*suiteRunner).run(0xc20041c000, 0xc200445600)
 /home/tarmac/trees/src/launchpad.net/gocheck/gocheck.go:584 +0x1c5
launchpad.net/g...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'worker/instancepoller/machine_test.go'
2--- worker/instancepoller/machine_test.go 2014-04-01 23:56:19 +0000
3+++ worker/instancepoller/machine_test.go 2014-04-09 03:09:15 +0000
4@@ -8,6 +8,7 @@
5 stderrors "errors"
6 "fmt"
7 "math"
8+ "strings"
9 "sync"
10 "sync/atomic"
11 "time"
12@@ -61,24 +62,31 @@
13 func (s *machineSuite) TestShortPollIntervalWhenNoAddress(c *gc.C) {
14 s.PatchValue(&ShortPoll, 1*time.Millisecond)
15 s.PatchValue(&LongPoll, coretesting.LongWait)
16- count := countPolls(c, nil, "running", params.StatusStarted)
17+ count := countPolls(c, nil, "i1234", "running", params.StatusStarted)
18 c.Assert(count, jc.GreaterThan, 2)
19 }
20
21 func (s *machineSuite) TestShortPollIntervalWhenNoStatus(c *gc.C) {
22 s.PatchValue(&ShortPoll, 1*time.Millisecond)
23 s.PatchValue(&LongPoll, coretesting.LongWait)
24- count := countPolls(c, testAddrs, "", params.StatusStarted)
25+ count := countPolls(c, testAddrs, "i1234", "", params.StatusStarted)
26 c.Assert(count, jc.GreaterThan, 2)
27 }
28
29 func (s *machineSuite) TestShortPollIntervalWhenNotStarted(c *gc.C) {
30 s.PatchValue(&ShortPoll, 1*time.Millisecond)
31 s.PatchValue(&LongPoll, coretesting.LongWait)
32- count := countPolls(c, testAddrs, "pending", params.StatusPending)
33+ count := countPolls(c, testAddrs, "i1234", "pending", params.StatusPending)
34 c.Assert(count, jc.GreaterThan, 2)
35 }
36
37+func (s *machineSuite) TestShortPollIntervalWhenNotProvisioned(c *gc.C) {
38+ s.PatchValue(&ShortPoll, 1*time.Millisecond)
39+ s.PatchValue(&LongPoll, coretesting.LongWait)
40+ count := countPolls(c, testAddrs, "", "pending", params.StatusPending)
41+ c.Assert(count, gc.Equals, 0)
42+}
43+
44 func (s *machineSuite) TestShortPollIntervalExponent(c *gc.C) {
45 s.PatchValue(&ShortPoll, 1*time.Microsecond)
46 s.PatchValue(&LongPoll, coretesting.LongWait)
47@@ -89,7 +97,7 @@
48 // ShortPollBackoff of ShortWait/ShortPoll, given that sleep will
49 // sleep for at least the requested interval.
50 maxCount := int(math.Log(float64(coretesting.ShortWait)/float64(ShortPoll))/math.Log(ShortPollBackoff) + 1)
51- count := countPolls(c, nil, "", params.StatusStarted)
52+ count := countPolls(c, nil, "i1234", "", params.StatusStarted)
53 c.Assert(count, jc.GreaterThan, 2)
54 c.Assert(count, jc.LessThan, maxCount)
55 c.Logf("actual count: %v; max %v", count, maxCount)
56@@ -98,7 +106,7 @@
57 func (s *machineSuite) TestLongPollIntervalWhenHasAllInstanceInfo(c *gc.C) {
58 s.PatchValue(&ShortPoll, coretesting.LongWait)
59 s.PatchValue(&LongPoll, 1*time.Millisecond)
60- count := countPolls(c, testAddrs, "running", params.StatusStarted)
61+ count := countPolls(c, testAddrs, "i1234", "running", params.StatusStarted)
62 c.Assert(count, jc.GreaterThan, 2)
63 }
64
65@@ -106,10 +114,10 @@
66 // addresses and status to be returned from getInstanceInfo,
67 // waits for coretesting.ShortWait, and returns the
68 // number of times the instance is polled.
69-func countPolls(c *gc.C, addrs []instance.Address, instStatus string, machineStatus params.Status) int {
70+func countPolls(c *gc.C, addrs []instance.Address, instId, instStatus string, machineStatus params.Status) int {
71 count := int32(0)
72 getInstanceInfo := func(id instance.Id) (instanceInfo, error) {
73- c.Check(id, gc.Equals, instance.Id("i1234"))
74+ c.Check(string(id), gc.Equals, instId)
75 atomic.AddInt32(&count, 1)
76 if addrs == nil {
77 return instanceInfo{}, fmt.Errorf("no instance addresses available")
78@@ -122,7 +130,7 @@
79 }
80 m := &testMachine{
81 id: "99",
82- instanceId: "i1234",
83+ instanceId: instance.Id(instId),
84 refresh: func() error { return nil },
85 addresses: addrs,
86 life: state.Alive,
87@@ -342,11 +350,23 @@
88 }
89
90 func (m *testMachine) InstanceId() (instance.Id, error) {
91+ if m.instanceId == "" {
92+ return "", state.NotProvisionedError(m.Id())
93+ }
94 return m.instanceId, m.instanceIdErr
95 }
96
97+// This is stubbed out for testing.
98+var MachineStatus = func(m *testMachine) (status params.Status, info string, data params.StatusData, err error) {
99+ return m.status, "", nil, nil
100+}
101+
102 func (m *testMachine) Status() (status params.Status, info string, data params.StatusData, err error) {
103- return m.status, "", nil, nil
104+ return MachineStatus(m)
105+}
106+
107+func (m *testMachine) IsManual() (bool, error) {
108+ return strings.HasPrefix(string(m.instanceId), "manual:"), nil
109 }
110
111 func (m *testMachine) InstanceStatus() (string, error) {
112
113=== modified file 'worker/instancepoller/updater.go'
114--- worker/instancepoller/updater.go 2014-03-30 22:34:01 +0000
115+++ worker/instancepoller/updater.go 2014-04-09 03:09:15 +0000
116@@ -42,6 +42,7 @@
117 Refresh() error
118 Life() state.Life
119 Status() (status params.Status, info string, data params.StatusData, err error)
120+ IsManual() (bool, error)
121 }
122
123 type instanceInfo struct {
124@@ -132,6 +133,14 @@
125 if err != nil {
126 return err
127 }
128+ // We don't poll manual machines.
129+ isManual, err := m.IsManual()
130+ if err != nil {
131+ return err
132+ }
133+ if isManual {
134+ continue
135+ }
136 c = make(chan struct{})
137 p.machines[id] = c
138 go runMachine(p.context.newMachineContext(), m, c, p.machineDead)
139@@ -171,7 +180,7 @@
140 for {
141 if pollInstance {
142 instInfo, err := pollInstanceInfo(context, m)
143- if err != nil {
144+ if err != nil && !state.IsNotProvisionedError(err) {
145 // If the provider doesn't implement Addresses/Status now,
146 // it never will until we're upgraded, so don't bother
147 // asking any more. We could use less resources
148@@ -185,9 +194,11 @@
149 return err
150 }
151 }
152- machineStatus, _, _, err := m.Status()
153- if err != nil {
154- logger.Warningf("cannot get current machine status for machine %v: %v", m.Id(), err)
155+ machineStatus := params.StatusPending
156+ if err == nil {
157+ if machineStatus, _, _, err = m.Status(); err != nil {
158+ logger.Warningf("cannot get current machine status for machine %v: %v", m.Id(), err)
159+ }
160 }
161 if len(instInfo.addresses) > 0 && instInfo.status != "" && machineStatus == params.StatusStarted {
162 // We've got at least one address and a status and instance is started, so poll infrequently.
163@@ -220,7 +231,11 @@
164 func pollInstanceInfo(context machineContext, m machine) (instInfo instanceInfo, err error) {
165 instInfo = instanceInfo{}
166 instId, err := m.InstanceId()
167- if err != nil && !state.IsNotProvisionedError(err) {
168+ // We can't ask the machine for its addresses if it isn't provisioned yet.
169+ if state.IsNotProvisionedError(err) {
170+ return instInfo, err
171+ }
172+ if err != nil {
173 return instInfo, fmt.Errorf("cannot get machine's instance id: %v", err)
174 }
175 instInfo, err = context.instanceInfo(instId)
176
177=== modified file 'worker/instancepoller/updater_test.go'
178--- worker/instancepoller/updater_test.go 2014-03-13 07:54:56 +0000
179+++ worker/instancepoller/updater_test.go 2014-04-09 03:09:15 +0000
180@@ -13,6 +13,7 @@
181 gc "launchpad.net/gocheck"
182
183 "launchpad.net/juju-core/state"
184+ "launchpad.net/juju-core/state/api/params"
185 coretesting "launchpad.net/juju-core/testing"
186 "launchpad.net/juju-core/testing/testbase"
187 )
188@@ -119,6 +120,57 @@
189 c.Assert(watcher.stopped, jc.IsTrue)
190 }
191
192+func (s *updaterSuite) TestManualMachinesIgnored(c *gc.C) {
193+ waitStatus := make(chan struct{})
194+ s.PatchValue(&MachineStatus, func(m *testMachine) (status params.Status, info string, data params.StatusData, err error) {
195+ // Signal that we're in Status.
196+ waitStatus <- struct{}{}
197+ return params.StatusPending, "", params.StatusData{}, nil
198+ })
199+ m := &testMachine{
200+ id: "99",
201+ instanceId: "manual:1234",
202+ life: state.Alive,
203+ }
204+ dyingc := make(chan struct{})
205+ context := &testUpdaterContext{
206+ dyingc: dyingc,
207+ newMachineContextFunc: func() machineContext {
208+ return &testMachineContext{
209+ getInstanceInfo: instanceInfoGetter(c, "manual:1234", testAddrs, "running", nil),
210+ dyingc: dyingc,
211+ }
212+ },
213+ getMachineFunc: func(id string) (machine, error) {
214+ c.Check(id, gc.Equals, m.id)
215+ return m, nil
216+ },
217+ }
218+ watcher := &testMachinesWatcher{
219+ changes: make(chan []string),
220+ }
221+ done := make(chan error)
222+ go func() {
223+ done <- watchMachinesLoop(context, watcher)
224+ }()
225+ // Send a change to start the machineLoop;
226+ watcher.changes <- []string{"99"}
227+ select {
228+ case <-waitStatus:
229+ c.Fatalf("poller called Status")
230+ case <-time.After(coretesting.ShortWait):
231+ c.Logf("status not called")
232+ }
233+ close(context.dyingc)
234+ select {
235+ case err := <-done:
236+ c.Assert(err, gc.IsNil)
237+ case <-time.After(coretesting.LongWait):
238+ c.Fatalf("timed out waiting for watchMachinesLoop to terminate")
239+ }
240+ c.Assert(watcher.stopped, jc.IsTrue)
241+}
242+
243 type testUpdaterContext struct {
244 newMachineContextFunc func() machineContext
245 getMachineFunc func(id string) (machine, error)

Subscribers

People subscribed via source and target branches

to status/vote changes: