Skip to content

Commit

Permalink
restore error message on restarting in a different mode
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Oct 23, 2024
1 parent b245d4e commit 84f9a10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ async def configure(self, params):
if run_mode != og_run_mode:
raise InputError(
"This workflow was originally run in "
f"{run_mode.value} mode:"
f"{og_run_mode.value} mode:"
f" Will not restart in {run_mode.value} mode."
)

Expand Down
5 changes: 3 additions & 2 deletions tests/integration/test_mode_on_restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from cylc.flow.exceptions import InputError
from cylc.flow.scheduler import Scheduler
from cylc.flow.run_modes import RunMode


MODES = [('live'), ('simulation'), ('dummy')]
Expand All @@ -42,7 +43,7 @@ async def test_restart_mode(
async with start(schd):
if not mode_before:
mode_before = 'live'
assert schd.get_run_mode() == mode_before
assert schd.get_run_mode().value == mode_before

schd = scheduler(id_, run_mode=mode_after)

Expand All @@ -52,7 +53,7 @@ async def test_restart_mode(
):
# Restarting in the same mode is fine.
async with run(schd):
assert schd.get_run_mode() == mode_before
assert schd.get_run_mode().value == mode_before
else:
# Restarting in a new mode is not:
errormsg = f'^This.*{mode_before} mode: Will.*{mode_after} mode.$'
Expand Down

0 comments on commit 84f9a10

Please sign in to comment.