Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions azure/durable_functions/models/Task.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ def __init__(self, tasks: List[TaskBase], compound_action_constructor=None):
self.completed_tasks: List[TaskBase] = []
self.children = tasks

if len(self.children) == 0:
self.state = TaskState.SUCCEEDED

def handle_completion(self, child: TaskBase):
"""Manage sub-task completion events.

Expand Down
13 changes: 13 additions & 0 deletions tests/orchestrator/test_task_any.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ def generator_function(context):
except:
return "exception"

def generator_function_no_activity(context):
yield context.task_any([])
return "Done!"

def test_continues_on_zero_inner_tasks():
context_builder = ContextBuilder()
result = get_orchestration_state_result(
context_builder, generator_function_no_activity)
expected_state = base_expected_state("Done!")
expected_state._is_done = True
expected = expected_state.to_json()
assert_orchestration_state_equals(expected, result)

def test_continues_on_zero_results():
context_builder = ContextBuilder()
result = get_orchestration_state_result(
Expand Down