Skip to content

Commit

Permalink
No randomness if < 10 workers to choose from
Browse files Browse the repository at this point in the history
Fixes flaky `test_balance_with_restrictions`
  • Loading branch information
gjoseph92 committed Jun 21, 2021
1 parent 13975cb commit fcb165e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7501,6 +7501,8 @@ def decide_worker(
sample_from = idle_workers or worker_pool
candidates.update(
random.choices(list(sample_from), k=min(10, len(sample_from)))
if len(sample_from) > 10
else sample_from
)
if valid_workers is None:
if not candidates:
Expand Down

0 comments on commit fcb165e

Please sign in to comment.