Skip to content

Commit

Permalink
Set expected concurrency count to 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
nzlosh committed Apr 2, 2024
1 parent f4453a0 commit 91d5cab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion orquesta/conducting.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ def _evaluate_task_actions(self, task):
if task["concurrency"] is not None:
# Concurrency below 1 prevents scheduling of tasks.
if task["concurrency"] <= 0:
task["concurrency"] = 1
task["concurrency"] = 1
availability = task["concurrency"] - len(active_items)
candidates = list(zip(*notrun_items[:availability]))
task["actions"] = list(candidates[0]) if candidates and availability > 0 else []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ def test_basic_items_list_with_zero_concurrency(self):
- items: <% ctx(items) %>
"""

concurrency = 0
# Set the concurrency to 1 since concurrency 0 is expected to be
# overridden in the Orquesta concurrency scheduling code.
concurrency = 1

spec = native_specs.WorkflowSpec(wf_def)
self.assertDictEqual(spec.inspect(), {})
Expand Down Expand Up @@ -460,7 +462,6 @@ def test_basic_items_list_with_zero_concurrency(self):
# Assert the workflow succeeded.
self.assertEqual(conductor.get_workflow_status(), statuses.SUCCEEDED)


def test_multiple_items_list(self):
wf_def = """
version: 1.0
Expand Down

0 comments on commit 91d5cab

Please sign in to comment.