From 1a81b00b90af5d348f5b41bef85f8efee8ca4b91 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Thu, 3 Dec 2020 13:21:54 -0800 Subject: [PATCH] Coerce new `TaskState.nbytes` value to `int` 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. --- distributed/tests/test_steal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distributed/tests/test_steal.py b/distributed/tests/test_steal.py index 8db31aa8b62..8277ede1833 100644 --- a/distributed/tests/test_steal.py +++ b/distributed/tests/test_steal.py @@ -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: