Merge lp:~frankban/juju-gui/bug-1169973-dying-services into lp:juju-gui/experimental
Proposed by
Francesco Banconi
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 572 | ||||
Proposed branch: | lp:~frankban/juju-gui/bug-1169973-dying-services | ||||
Merge into: | lp:juju-gui/experimental | ||||
Diff against target: | 0 lines | ||||
To merge this branch: | bzr merge lp:~frankban/juju-gui/bug-1169973-dying-services | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+159443@code.launchpad.net |
Description of the change
Do not hide dying services in an error state
Due to bug 1168154, removing a service in an error state
does not really destroy the service, that will be
eventually destroyed once all its units are resolved.
A dying unit could also fail executing the stop hook,
leaving the service undead in the juju database.
For this reason, we don't wont to hide services in an
erro state, even if they are dying.
QA:
- deploy buildbot-master;
- destroy it;
- wait a second, you should see it return like a
red zombie.
To post a comment you must log in.
Reviewers: mp+159443_ code.launchpad. net,
Message:
Please take a look.
Description:
Do not hide dying services in an error state
Due to bug 1168154, removing a service in an error state
does not really destroy the service, that will be
eventually destroyed once all its units are resolved.
A dying unit could also fail executing the stop hook,
leaving the service undead in the juju database.
For this reason, we don't wont to hide services in an
erro state, even if they are dying.
QA:
- deploy buildbot-master;
- destroy it;
- wait a second, you should see it return like a
red zombie.
https:/ /code.launchpad .net/~frankban/ juju-gui/ bug-1169973- dying-services/ +merge/ 159443
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/8835043/
Affected files: models. js topology/ service. js service_ module. js
A [revision details]
M app/models/
M app/views/
M test/test_model.js
M test/test_
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: test/test_model.js model.js'
=== modified file 'test/test_
--- test/test_model.js 2013-04-17 13:28:40 +0000
+++ test/test_model.js 2013-04-17 15:45:59 +0000
@@ -646,7 +646,7 @@
describe('service models', function() {
- var models, list, django, rails, mysql;
+ var models, list, django, rails, wordpress, mysql;
before( function( done) { GlobalConfig) .use([' juju-models' ], function(Y) {
YUI(
@@ -657,9 +657,22 @@
beforeEach( function( ) { ServiceList( {items: [rails, django, mysql]}); ServiceList( {items: [rails, django, wordpress,
django = new models.Service({id: 'django'});
- rails = new models.Service({id: 'rails', life: 'dying'});
- mysql = new models.Service({id: 'mysql', life: 'dead'});
- list = new models.
+ rails = new models.Service({
+ id: 'rails',
+ life: 'dying',
+ aggregated_status: {}
+ });
+ wordpress = new models.Service({
+ id: 'wordpress',
+ life: 'dying',
+ aggregated_status: {error: 42}
+ });
+ mysql = new models.Service({
+ id: 'mysql',
+ life: 'dead',
+ aggregated_status: {error: 0}
+ });
+ list = new models.
mysql]});
});
it('instances identify if they are alive', function() {
@@ -668,14 +681,25 @@
});
it('instances identify if they are not alive (dying or dead)', isFalse( rails.isAlive( )); isFalse( mysql.isAlive( )); strictEqual( 1, filtered.size()); deepEqual( [django] , filtered. toArray( )); isFalse( rails.isAlive( ), rails.get('id')); isFalse( wordpress. isAlive( ), wordpress. get('id' )); isFalse( mysql.isAlive( ), mysql.get('id')); isTrue( wordpress. hasEr.. .
function() {
- assert.
- assert.
- });
-
- it('can be filtered so that it returns only alive models', function() {
- var filtered = list.alive();
- assert.
- assert.
+ assert.
+ assert.
+ assert.
+ });
+
+ it('instances identify if they they have errors', function() {
+ assert.