Skip to content

Commit

Permalink
fix database updating failures. Update lexer wordlists.
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Sep 25, 2024
1 parent 42898a5 commit 5585e3c
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 8 deletions.
7 changes: 5 additions & 2 deletions cylc/flow/etc/syntax/cylc.lang
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
<keyword>work sub-directory</keyword>
<keyword>warning handlers</keyword>
<keyword>verbose mode</keyword>
<keyword>user</keyword>
<keyword>to</keyword>
<keyword>title</keyword>
<keyword>time limit buffer</keyword>
Expand All @@ -116,15 +115,17 @@
<keyword>stall handlers</keyword>
<keyword>speedup factor</keyword>
<keyword>special tasks</keyword>
<keyword>skip</keyword>
<keyword>simulation</keyword>
<keyword>shutdown handlers</keyword>
<keyword>sequential xtriggers</keyword>
<keyword>sequential</keyword>
<keyword>script</keyword>
<keyword>scheduling</keyword>
<keyword>scheduler</keyword>
<keyword>runtime</keyword>
<keyword>runahead limit</keyword>
<keyword>run-dir</keyword>
<keyword>run mode</keyword>
<keyword>retry handlers</keyword>
<keyword>retrieve job logs retry delays</keyword>
<keyword>retrieve job logs max size</keyword>
Expand Down Expand Up @@ -198,10 +199,12 @@
<keyword>cycle point format</keyword>
<keyword>custom handlers</keyword>
<keyword>critical handlers</keyword>
<keyword>completion</keyword>
<keyword>clock-trigger</keyword>
<keyword>clock-expire</keyword>
<keyword>batch system</keyword>
<keyword>batch submit command template</keyword>
<keyword>alt-cylc-run-dir</keyword>
<keyword>allow implicit tasks</keyword>
<keyword>abort on workflow timeout</keyword>
<keyword>abort on stall timeout</keyword>
Expand Down
7 changes: 5 additions & 2 deletions cylc/flow/etc/syntax/cylc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<RegExpr attribute='Keyword' String=' work sub-directory '/>
<RegExpr attribute='Keyword' String=' warning handlers '/>
<RegExpr attribute='Keyword' String=' verbose mode '/>
<RegExpr attribute='Keyword' String=' user '/>
<RegExpr attribute='Keyword' String=' to '/>
<RegExpr attribute='Keyword' String=' title '/>
<RegExpr attribute='Keyword' String=' time limit buffer '/>
Expand All @@ -43,15 +42,17 @@
<RegExpr attribute='Keyword' String=' stall handlers '/>
<RegExpr attribute='Keyword' String=' speedup factor '/>
<RegExpr attribute='Keyword' String=' special tasks '/>
<RegExpr attribute='Keyword' String=' skip '/>
<RegExpr attribute='Keyword' String=' simulation '/>
<RegExpr attribute='Keyword' String=' shutdown handlers '/>
<RegExpr attribute='Keyword' String=' sequential xtriggers '/>
<RegExpr attribute='Keyword' String=' sequential '/>
<RegExpr attribute='Keyword' String=' script '/>
<RegExpr attribute='Keyword' String=' scheduling '/>
<RegExpr attribute='Keyword' String=' scheduler '/>
<RegExpr attribute='Keyword' String=' runtime '/>
<RegExpr attribute='Keyword' String=' runahead limit '/>
<RegExpr attribute='Keyword' String=' run-dir '/>
<RegExpr attribute='Keyword' String=' run mode '/>
<RegExpr attribute='Keyword' String=' retry handlers '/>
<RegExpr attribute='Keyword' String=' retrieve job logs retry delays '/>
<RegExpr attribute='Keyword' String=' retrieve job logs max size '/>
Expand Down Expand Up @@ -125,10 +126,12 @@
<RegExpr attribute='Keyword' String=' cycle point format '/>
<RegExpr attribute='Keyword' String=' custom handlers '/>
<RegExpr attribute='Keyword' String=' critical handlers '/>
<RegExpr attribute='Keyword' String=' completion '/>
<RegExpr attribute='Keyword' String=' clock-trigger '/>
<RegExpr attribute='Keyword' String=' clock-expire '/>
<RegExpr attribute='Keyword' String=' batch system '/>
<RegExpr attribute='Keyword' String=' batch submit command template '/>
<RegExpr attribute='Keyword' String=' alt-cylc-run-dir '/>
<RegExpr attribute='Keyword' String=' allow implicit tasks '/>
<RegExpr attribute='Keyword' String=' abort on workflow timeout '/>
<RegExpr attribute='Keyword' String=' abort on stall timeout '/>
Expand Down
5 changes: 3 additions & 2 deletions cylc/flow/run_modes/skip.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ def submit_task_job(
'try_num': itask.get_try_num(),
'flow_nums': str(list(itask.flow_nums)),
'is_manual_submit': itask.is_manual_submit,
'job_runner_name': RunMode.SIMULATION.value,
'platform_name': RunMode.SIMULATION.value,
'job_runner_name': RunMode.SKIP.value,
'platform_name': RunMode.SKIP.value,
'submit_status': 0 # Submission has succeeded
}
)
task_job_mgr.workflow_db_mgr.put_update_task_state(itask)
for output in process_outputs(itask, rtconfig):
task_job_mgr.task_events_mgr.process_message(itask, INFO, output)

Expand Down
5 changes: 5 additions & 0 deletions cylc/flow/task_job_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ def submit_livelike_task_jobs(
'platform_name': itask.platform['name'],
'job_runner_name': itask.summary['job_runner_name'],
})

itask.is_manual_submit = False

if ri_map[install_target] == REMOTE_FILE_INSTALL_255:
Expand Down Expand Up @@ -1080,6 +1081,10 @@ def submit_nonlive_task_jobs(
self, itask, rtconfig, workflow, now)

if nonlive_mode:
self.workflow_db_mgr.put_insert_task_states(
itask, {
'submit_num': itask.submit_num,
'flow_nums': serialise_set(itask.flow_nums)})
nonlive_tasks.append(itask)
else:
lively_tasks.append(itask)
Expand Down
26 changes: 24 additions & 2 deletions tests/integration/run_modes/test_nonlive.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
'run_signal': None,
'run_status': 0,
'platform_name': 'skip',
'job_runner_name': 'simulation',
'job_runner_name': 'skip',
'job_id': None},
}

Expand All @@ -47,7 +47,7 @@ def not_time(data: Dict[str, Any]):
return {k: v for k, v in data.items() if 'time' not in k}


async def test_task_jobs(flow, scheduler, start, capture_live_submissions):
async def test_db_task_jobs(flow, scheduler, start, capture_live_submissions):
"""Ensure that task job data is added to the database correctly
for each run mode.
"""
Expand Down Expand Up @@ -94,6 +94,28 @@ async def test_task_jobs(flow, scheduler, start, capture_live_submissions):
assert task_proxies[1].run_mode == 'skip'


async def test_db_task_states(
one_conf, flow, scheduler, start
):
"""Test that tasks will have the same information entered into the task
state database whichever mode is used.
"""
conf = one_conf
conf['runtime'] = {'one': {'run mode': 'skip'}}
schd = scheduler(flow(conf))
async with start(schd):
schd.task_job_mgr.submit_task_jobs(
schd.workflow,
schd.pool.get_tasks(),
schd.server.curve_auth,
schd.server.client_pub_key_dir
)
schd.workflow_db_mgr.process_queued_ops()
result = schd.workflow_db_mgr.pri_dao.connect().execute(
'SELECT * FROM task_states').fetchone()
assert result[5] == 1


async def test_mean_task_time(
flow, scheduler, start, complete, capture_live_submissions
):
Expand Down

0 comments on commit 5585e3c

Please sign in to comment.