Skip to content

Commit

Permalink
trivial fix
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky committed Jun 17, 2022
1 parent 39d789e commit c31b7b6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions distributed/worker_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -3021,10 +3021,12 @@ def validate_state(self) -> None:
assert worker in self.tasks[k].who_has

for worker, tss in self.data_needed.items():
# Test that there aren't multiple TaskState objects with the same key in the
# set
assert len({ts.key for ts in tss}) == len(tss)
for ts in tss:
assert ts.state == "fetch"
assert self.tasks[ts.key] is ts
assert ts in self.data_needed
assert worker in ts.who_has

for ts in self.tasks.values():
Expand All @@ -3033,10 +3035,6 @@ def validate_state(self) -> None:
if self.transition_counter_max:
assert self.transition_counter < self.transition_counter_max

# Test that there aren't multiple TaskState objects with the same key in sets
for tss in self.data_needed.values():
assert len({ts.key for ts in tss}) == len(tss)


class BaseWorker(abc.ABC):
"""Wrapper around the :class:`WorkerState` that implements instructions handling.
Expand Down

0 comments on commit c31b7b6

Please sign in to comment.