diff --git a/cylc/flow/commands.py b/cylc/flow/commands.py index 3481aaaa61..198cd6f71c 100644 --- a/cylc/flow/commands.py +++ b/cylc/flow/commands.py @@ -364,7 +364,6 @@ async def reload_workflow(schd: 'Scheduler', reload_global: bool = False): # give commands time to complete sleep(1) # give any remove-init's time to complete - if reload_global: # Reload global config if requested LOG.info("Reloading the global configuration.") @@ -384,7 +383,6 @@ async def reload_workflow(schd: 'Scheduler', reload_global: bool = False): ' again.' ) - # reload the workflow definition schd.reload_pending = 'loading the workflow definition' schd.update_data_store() # update workflow status msg diff --git a/tests/integration/test_reload.py b/tests/integration/test_reload.py index 0a91c416d0..2871feb83f 100644 --- a/tests/integration/test_reload.py +++ b/tests/integration/test_reload.py @@ -171,18 +171,18 @@ async def test_reload_global( """) assert glbl_cfg(reload=True).get(['platforms','localhost','meta','x']) == '1' - # Modify the global config file - global_config_path.write_text(""" - [platforms] - [[localhost]] - [[[meta]]] - x = 2 - """) - id_ = flow(one_conf) schd = scheduler(id_) async with start(schd) as log: + # Modify the global config file + global_config_path.write_text(""" + [platforms] + [[localhost]] + [[[meta]]] + x = 2 + """) + # reload the workflow and global config await commands.run_cmd(commands.reload_workflow, schd, reload_global=True) @@ -196,3 +196,25 @@ async def test_reload_global( # Task platforms reflect the new config assert schd.pool.get_tasks()[0].platform['meta']['x'] == '2' + + # Modify the global config file with an error + global_config_path.write_text(""" + [ERROR] + [[localhost]] + [[[meta]]] + x = 3 + """) + + # reload the workflow and global config + await commands.run_cmd(commands.reload_workflow, schd, reload_global=True) + + # Error is noted in the log + assert log_filter( + log, + contains=( + 'This is probably due to an issue with the new configuration.' + ) + ) + + # Task platforms should be the last valid value + assert schd.pool.get_tasks()[0].platform['meta']['x'] == '2'