Skip to content

Commit 543bc71

Browse files
committed
fix(test): use invoke_group in test_multiple_invokes to avoid race
With invoke=[task_a, task_b], each task is a separate invocation that sends its own done.invoke — the first one triggers the transition and cancels the second. Using invoke_group ensures both complete before a single done.invoke is sent.
1 parent aa9a572 commit 543bc71

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/test_invoke.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def task_b():
254254
return "b"
255255

256256
class SM(StateChart):
257-
loading = State(initial=True, invoke=[task_a, task_b])
257+
loading = State(initial=True, invoke=invoke_group(task_a, task_b))
258258
ready = State(final=True)
259259
done_invoke_loading = loading.to(ready)
260260

0 commit comments

Comments
 (0)