Skip to content

Commit da330fc

Browse files
committed
Fix tests
1 parent 450728a commit da330fc

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

tests/integration/test_data_store_mgr.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,9 @@ async def test_delta_task_state(harness):
194194
async def test_delta_task_held(harness):
195195
"""Test update_data_structure. This method will generate and
196196
apply adeltas/updates given."""
197+
schd: Scheduler
197198
schd, data = harness
198-
schd.pool.hold_tasks('*')
199+
schd.pool.hold_tasks(['*'])
199200
await schd.update_data_structure()
200201
assert True in {t.is_held for t in data[TASK_PROXIES].values()}
201202
for itask in schd.pool.get_tasks():
@@ -270,7 +271,7 @@ async def test_update_data_structure(harness):
270271
schd, data = harness
271272
w_id = schd.data_store_mgr.workflow_id
272273
schd.data_store_mgr.data[w_id] = data
273-
schd.pool.hold_tasks('*')
274+
schd.pool.hold_tasks(['*'])
274275
await schd.update_data_structure()
275276
assert TASK_STATUS_FAILED not in set(collect_states(data, TASK_PROXIES))
276277
assert TASK_STATUS_FAILED not in set(collect_states(data, FAMILY_PROXIES))

tests/integration/test_graphql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async def harness(mod_flow, mod_scheduler, mod_run):
9494
schd: 'Scheduler' = mod_scheduler(id_)
9595
async with mod_run(schd):
9696
client = WorkflowRuntimeClient(id_)
97-
schd.pool.hold_tasks('*')
97+
schd.pool.hold_tasks(['*'])
9898
schd.resume_workflow()
9999
# Think this is needed to save the data state at first start (?)
100100
# Fails without it.. and a test needs to overwrite schd data with this.

tests/integration/test_queues.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import pytest
22

3+
from cylc.flow.scheduler import Scheduler
4+
35

46
@pytest.fixture
57
def param_workflow(flow, scheduler):
@@ -86,7 +88,7 @@ async def test_queue_held_tasks(
8688
8789
https://github.com/cylc/cylc-flow/issues/4628
8890
"""
89-
schd = param_workflow(paused_start=True, queue_limit=1)
91+
schd: Scheduler = param_workflow(paused_start=True, queue_limit=1)
9092

9193
async with start(schd):
9294
# capture task submissions (prevents real submissions)
@@ -97,7 +99,7 @@ async def test_queue_held_tasks(
9799

98100
# hold all tasks and resume the workflow
99101
# (nothing should have run yet because the workflow started paused)
100-
schd.command_hold('*/*')
102+
schd.command_hold(['*/*'])
101103
schd.resume_workflow()
102104

103105
# release queued tasks
@@ -106,7 +108,7 @@ async def test_queue_held_tasks(
106108
assert len(submitted_tasks) == 0
107109

108110
# un-hold tasks
109-
schd.command_release('*/*')
111+
schd.command_release(['*/*'])
110112

111113
# release queued tasks
112114
# (tasks should now be released from the queues)

tests/integration/test_task_pool.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,17 +497,19 @@ async def test_hold_point(
497497
(TASK_STATUS_SUCCEEDED, True),
498498
]
499499
)
500-
async def test_trigger_states(status, should_trigger, one, start):
500+
async def test_trigger_states(
501+
status: str, should_trigger: bool, one: 'Scheduler', start: Callable
502+
):
501503
"""It should only trigger tasks in compatible states."""
502504

503505
async with start(one):
504-
task = one.pool.filter_task_proxies('1/a')[0][0]
506+
task = one.pool.filter_task_proxies(['1/one'])[0][0]
505507

506508
# reset task a to the provided state
507509
task.state.reset(status)
508510

509511
# try triggering the task
510-
one.pool.force_trigger_tasks('1/a', [FLOW_ALL])
512+
one.pool.force_trigger_tasks(['1/one'], [FLOW_ALL])
511513

512514
# check whether the task triggered
513515
assert task.is_manual_submit == should_trigger
@@ -1219,7 +1221,7 @@ async def test_detect_incomplete_tasks(
12191221
# the task should not have been removed
12201222
assert itask in schd.pool.get_tasks()
12211223

1222-
1224+
12231225
async def test_future_trigger_final_point(
12241226
flow,
12251227
scheduler,

0 commit comments

Comments
 (0)