File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2752,10 +2752,10 @@ def _raise_for_status(entities, status):
27522752 # errors to raise at the end
27532753 break
27542754 for unit in app .units :
2755- if unit .machine is not None and unit .machine .status == "error" :
2755+ if raise_on_error and unit .machine is not None and unit .machine .status == "error" :
27562756 errors .setdefault ("Machine" , []).append (unit .machine .id )
27572757 continue
2758- if unit .agent_status == "error" :
2758+ if raise_on_error and unit .agent_status == "error" :
27592759 errors .setdefault ("Agent" , []).append (unit .name )
27602760 continue
27612761 if raise_on_error and unit .workload_status == "error" :
Original file line number Diff line number Diff line change 1414
1515logger = logging .getLogger (__name__ )
1616
17+ from ..utils import INTEGRATION_TEST_DIR
1718
1819@base .bootstrapped
1920async def test_action (event_loop ):
@@ -191,17 +192,16 @@ async def test_upgrade_local_charm(event_loop):
191192@base .bootstrapped
192193async def test_upgrade_local_charm_resource (event_loop ):
193194 async with base .CleanModel () as model :
194- tests_dir = Path (__file__ ).absolute ().parent
195- charm_path = tests_dir / 'file-resource-charm'
195+ charm_path = INTEGRATION_TEST_DIR / 'file-resource-charm'
196196 resources = {"file-res" : "test.file" }
197197
198198 app = await model .deploy (str (charm_path ), resources = resources )
199199 assert 'file-resource-charm' in model .applications
200- await model .wait_for_idle ()
200+ await model .wait_for_idle (raise_on_error = False )
201201 assert app .units [0 ].agent_status == 'idle'
202202
203203 await app .upgrade_charm (path = charm_path , resources = resources )
204- await model .wait_for_idle ()
204+ await model .wait_for_idle (raise_on_error = False )
205205 ress = await app .get_resources ()
206206 assert 'file-res' in ress
207207 assert ress ['file-res' ]
You can’t perform that action at this time.
0 commit comments