Merge lp://staging/~rogpeppe/juju-core/306-worker-fix-go1.0 into lp://staging/~juju/juju-core/trunk

Proposed by Roger Peppe
Status: Merged
Merged at revision: 1232
Proposed branch: lp://staging/~rogpeppe/juju-core/306-worker-fix-go1.0
Merge into: lp://staging/~juju/juju-core/trunk
Diff against target: 136 lines (+19/-13)
2 files modified
worker/runner.go (+2/-2)
worker/runner_test.go (+17/-11)
To merge this branch: bzr merge lp://staging/~rogpeppe/juju-core/306-worker-fix-go1.0
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+165466@code.staging.launchpad.net

Description of the change

worker: fix for go1.0.3 compatibility

oops.

https://codereview.appspot.com/9682047/

To post a comment you must log in.
Revision history for this message
Roger Peppe (rogpeppe) wrote :
Download full text (5.4 KiB)

Reviewers: mp+165466_code.launchpad.net,

Message:
Please take a look.

Description:
worker: fix for go1.0.3 compatibility

oops.

https://code.launchpad.net/~rogpeppe/juju-core/306-worker-fix-go1.0/+merge/165466

(do not edit description out of merge proposal)

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

Affected files:
   A [revision details]
   M worker/runner.go
   M worker/runner_test.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: <email address hidden>
+New revision: <email address hidden>

Index: worker/runner.go
=== modified file 'worker/runner.go'
--- worker/runner.go 2013-05-23 18:30:17 +0000
+++ worker/runner.go 2013-05-23 18:53:22 +0000
@@ -92,8 +92,8 @@
   case runner.startc <- startReq{id, startFunc}:
    return nil
   case <-runner.tomb.Dead():
- return ErrDead
   }
+ return ErrDead
  }

  // StopWorker stops the worker associated with the given id.
@@ -105,8 +105,8 @@
   case runner.stopc <- id:
    return nil
   case <-runner.tomb.Dead():
- return ErrDead
   }
+ return ErrDead
  }

  func (runner *Runner) Wait() error {

Index: worker/runner_test.go
=== modified file 'worker/runner_test.go'
--- worker/runner_test.go 2013-05-23 18:30:17 +0000
+++ worker/runner_test.go 2013-05-23 18:53:22 +0000
@@ -48,7 +48,7 @@
  func (*runnerSuite) TestOneWorkerStart(c *C) {
   runner := worker.NewRunner(noneFatal, noImportance)
   starter := newTestWorkerStarter()
- err := runner.StartWorker("id", starter.start)
+ err := runner.StartWorker("id", testWorkerStart(starter))
   c.Assert(err, IsNil)
   starter.assertStarted(c, true)

@@ -59,7 +59,7 @@
  func (*runnerSuite) TestOneWorkerRestart(c *C) {
   runner := worker.NewRunner(noneFatal, noImportance)
   starter := newTestWorkerStarter()
- err := runner.StartWorker("id", starter.start)
+ err := runner.StartWorker("id", testWorkerStart(starter))
   c.Assert(err, IsNil)
   starter.assertStarted(c, true)

@@ -78,7 +78,7 @@
   runner := worker.NewRunner(allFatal, noImportance)
   starter := newTestWorkerStarter()
   starter.startErr = errors.New("cannot start test task")
- err := runner.StartWorker("id", starter.start)
+ err := runner.StartWorker("id", testWorkerStart(starter))
   c.Assert(err, IsNil)
   err = runner.Wait()
   c.Assert(err, Equals, starter.startErr)
@@ -87,7 +87,7 @@
  func (*runnerSuite) TestOneWorkerDieFatalError(c *C) {
   runner := worker.NewRunner(allFatal, noImportance)
   starter := newTestWorkerStarter()
- err := runner.StartWorker("id", starter.start)
+ err := runner.StartWorker("id", testWorkerStart(starter))
   c.Assert(err, IsNil)
   starter.assertStarted(c, true)
   dieErr := errors.New("error when running")
@@ -100,7 +100,7 @@
  func (*runnerSuite) TestOneWorkerStartStop(c *C) {
   runner := worker.NewRunner(allFatal, noImportance)
   starter := newTestWorkerStarter()
- err := runner.StartWorker("id", starter.start)
+ err := runner.StartWorker("id", testWorkerStart(starter))
   c.Assert(err, IsNil)
   starter.assertStarted(c, tr...

Read more...

Revision history for this message
Frank Mueller (themue) wrote :

On 2013/05/23 18:55:31, rog wrote:
> Please take a look.

LGTM

https://codereview.appspot.com/9682047/

Revision history for this message
Madison Scott-Clary (makyo) wrote :
Revision history for this message
Dave Cheney (dave-cheney) wrote :

LGTM.

On Fri, May 24, 2013 at 5:13 AM, Matthew Scott
<email address hidden>wrote:

> LGTM, thanks for the fix
>
> https://codereview.appspot.com/9682047/
>
> --
>
> https://code.launchpad.net/~rogpeppe/juju-core/306-worker-fix-go1.0/+merge/165466
> Your team juju hackers is requested to review the proposed merge of
> lp:~rogpeppe/juju-core/306-worker-fix-go1.0 into lp:juju-core.
>

Revision history for this message
Roger Peppe (rogpeppe) wrote :

*** Submitted:

worker: fix for go1.0.3 compatibility

oops.

R=TheWorkingMue, matthew.scott
CC=
https://codereview.appspot.com/9682047

https://codereview.appspot.com/9682047/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches