Skip to content

Commit

Permalink
Coerce new TaskState.nbytes value to int (#4311)
Browse files Browse the repository at this point in the history
Make sure that whatever value we assign to `nbytes` is an `int`. This is
important as `Schedule.bandwidth` may be a `float`. So the value here
could be a `float`. Though we only measure `nbytes` in whole values.
  • Loading branch information
jakirkham authored Dec 3, 2020
1 parent 3407aa3 commit 7ea9696
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion distributed/tests/test_steal.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ async def assert_balanced(inp, expected, c, s, *workers):
ts = s.tasks[dat.key]
# Ensure scheduler state stays consistent
old_nbytes = ts.nbytes
ts.nbytes = s.bandwidth * t
ts.nbytes = int(s.bandwidth * t)
for ws in ts.who_has:
ws.nbytes += ts.nbytes - old_nbytes
else:
Expand Down

0 comments on commit 7ea9696

Please sign in to comment.