Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow-specific hold/release #5698

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Update flow release integration tests.
  • Loading branch information
hjoliver committed Sep 1, 2023
commit e1fb7fef643f8da328dc66ab5df4f0e1f1868d19
12 changes: 10 additions & 2 deletions tests/integration/test_task_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 450,24 @@ async def test_release_held_tasks(
assert get_task_ids(db_tasks_to_hold) == expected_tasks_to_hold_ids

# Test
task_pool.release_held_tasks(['1/foo', '3/asd'])
task_pool.release_held_tasks(['1/foo', '3/asd'], 1) # right flow, do release
for itask in task_pool.get_all_tasks():
assert itask.state.is_held is (itask.identity == '1/bar')

expected_tasks_to_hold_ids = sorted(['1/bar'])
task_pool.release_held_tasks(['1/bar'], 2) # wrong flow, don't release
for itask in task_pool.get_all_tasks():
assert itask.state.is_held is (itask.identity == '1/bar')

expected_tasks_to_hold_ids = ['1/bar']
assert get_task_ids(task_pool.hold_mgr._flatten()) == expected_tasks_to_hold_ids

db_tasks_to_hold = db_select(example_flow, True, 'tasks_to_hold')
assert get_task_ids(db_tasks_to_hold) == expected_tasks_to_hold_ids

task_pool.release_held_tasks(['1/bar']) # any flow, do release
for itask in task_pool.get_all_tasks():
assert itask.state.is_held is False


@pytest.mark.parametrize(
'hold_after_point, expected_held_task_ids',
Expand Down