Skip to content

Commit 99b482e

Browse files
authored
test: allow parallel branch observation ordering (#513)
1 parent fa85725 commit 99b482e

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

packages/aws-durable-execution-sdk-python-examples/test/parallel/test_parallel_with_named_branches.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,15 @@ def test_parallel_with_named_branches(durable_runner):
3838
# Verify branch names: named branches have custom names, unnamed use defaults
3939
assert len(parallel_op.child_operations) == 5
4040

41-
child_names = [op.name for op in parallel_op.child_operations]
42-
43-
# 1. Named ParallelBranch
44-
assert child_names[0] == "fetch-user-data"
45-
# 2. Named decorator
46-
assert child_names[1] == "fetch-orders"
47-
# 3. Unnamed decorator (None name falls back to index-based default)
48-
assert child_names[2] == "parallel-branch-2"
49-
# 4. Unnamed ParallelBranch (None name falls back to index-based default)
50-
assert child_names[3] == "parallel-branch-3"
51-
# 5. Raw callable (no ParallelBranch wrapper, index-based default)
52-
assert child_names[4] == "parallel-branch-4"
41+
child_names = {op.name for op in parallel_op.child_operations}
42+
43+
assert child_names == {
44+
"fetch-user-data", # Named ParallelBranch
45+
"fetch-orders", # Named decorator
46+
"parallel-branch-2", # Unnamed decorator
47+
"parallel-branch-3", # Unnamed ParallelBranch
48+
"parallel-branch-4", # Raw callable
49+
}
5350

5451
# Verify all children succeeded
5552
for child in parallel_op.child_operations:

0 commit comments

Comments
 (0)