Skip to content

Commit

Permalink
Fix flaky test_restart_waits_for_new_workers (dask#8573)
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky authored Mar 12, 2024
1 parent 40daaf0 commit 54ed6a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class WorkerState:
#: Read-only worker status, synced one way from the remote Worker object
status: Status

#: Cached hash of :attr:`~WorkerState.address`
#: Cached hash of :attr:`~WorkerState.server_id`
_hash: int

#: The total memory size, in bytes, used by the tasks this worker holds in memory
Expand Down
6 changes: 3 additions & 3 deletions distributed/tests/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,9 +1126,9 @@ async def test_restart_waits_for_new_workers(c, s, *workers):
# NOTE: == for `psutil.Process` compares PID and creation time
new_procs = {n.process.process for n in workers}
assert new_procs != original_procs
# The workers should have new addresses
assert s.workers.keys().isdisjoint(original_workers.keys())
# The old WorkerState instances should be replaced
# Most times, the workers should have new addresses
assert s.workers.keys() ^ original_workers.keys()
# The old WorkerState instances should have been replaced
assert set(s.workers.values()).isdisjoint(original_workers.values())


Expand Down

0 comments on commit 54ed6a1

Please sign in to comment.