Merge lp:~axwalk/juju-core/replicaset-test-race into lp:~go-bot/juju-core/trunk
Proposed by
Andrew Wilkins
Status: | Merged |
---|---|
Approved by: | Andrew Wilkins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2314 |
Proposed branch: | lp:~axwalk/juju-core/replicaset-test-race |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
22 lines (+8/-4) 1 file modified
replicaset/replicaset_test.go (+8/-4) |
To merge this branch: | bzr merge lp:~axwalk/juju-core/replicaset-test-race |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+205900@code.launchpad.net |
Commit message
replicaset: fix race/nil pointer deref in test
If CurrentStatus returns an error but there are
still more attempts, then the test continues on
and refers to a nil result.
Description of the change
replicaset: fix race/nil pointer deref in test
If CurrentStatus returns an error but there are
still more attempts, then the test continues on
and refers to a nil result.
As seen in:
https:/
To post a comment you must log in.
Reviewers: mp+205900_ code.launchpad. net,
Message:
Please take a look.
Description:
replicaset: fix race/nil pointer deref in test
If CurrentStatus returns an error but there are
still more attempts, then the test continues on
and refers to a nil result.
As seen in: /code.launchpad .net/~axwalk/ juju-core/ local-provider- testability/ +merge/ 204169/ comments/ 482324
https:/
https:/ /code.launchpad .net/~axwalk/ juju-core/ replicaset- test-race/ +merge/ 205900
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/62040043/
Affected files (+10, -4 lines): replicaset_ test.go
A [revision details]
M replicaset/
Index: [revision details] 20140211064343- d5yn0b3om93nuec j
=== 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-
+New revision: <email address hidden>
Index: replicaset/ replicaset_ test.go replicaset_ test.go' replicaset_ test.go 2014-01-13 21:18:11 +0000 replicaset_ test.go 2014-02-12 05:20:21 +0000 session)
=== modified file 'replicaset/
--- replicaset/
+++ replicaset/
@@ -348,10 +348,14 @@
for attempt.Next() {
var err error
res, err = CurrentStatus(
-
- if err != nil && !attempt.HasNext() {
- c.Errorf("Couldn't get status before timeout, got err: %v", err)
- return
+ if err != nil {
+ if !attempt.HasNext() {
+ c.Errorf("Couldn't get status before timeout, got err: %v", err)
+ return
+ } else {
+ // try again
+ continue
+ }
}
if res.Members[ 0].State == PrimaryState &&