diff --git a/message_passing/safe_message_handlers/activities.py b/message_passing/safe_message_handlers/activities.py index f3e369ce..da8a8be0 100644 --- a/message_passing/safe_message_handlers/activities.py +++ b/message_passing/safe_message_handlers/activities.py @@ -18,7 +18,7 @@ class ClusterState: @activity.defn async def start_cluster() -> ClusterState: - return ClusterState(node_ids=[f"{i}" for i in range(25)]) + return ClusterState(node_ids=[f"node-{i}" for i in range(25)]) @activity.defn @@ -47,7 +47,7 @@ class FindBadNodesInput: @activity.defn async def find_bad_nodes(input: FindBadNodesInput) -> Set[str]: await asyncio.sleep(0.1) - bad_nodes = set([n for n in input.nodes_to_check if int(n) % 5 == 0]) + bad_nodes = set([id for id in input.nodes_to_check if hash(id) % 5 == 0]) if bad_nodes: print(f"Found bad nodes: {bad_nodes}") else: