From 86a66f97560b7f3c5350af101d07bfe6265e3f28 Mon Sep 17 00:00:00 2001 From: Jim Crist Date: Fri, 15 Nov 2019 12:41:08 -0600 Subject: [PATCH] Fix failing test --- distributed/scheduler.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/distributed/scheduler.py b/distributed/scheduler.py index 9b0a84e8e8d..48fe6cac05c 100644 --- a/distributed/scheduler.py +++ b/distributed/scheduler.py @@ -2006,9 +2006,8 @@ def cancel_key(self, key, client, retries=5, force=False): return if ts is None or not ts.who_wants: # no key yet, lets try again in a moment if retries: - self.loop.add_future( - asyncio.sleep(0.2), - lambda _: self.cancel_key(key, client, retries - 1), + self.loop.call_later( + 0.2, lambda _: self.cancel_key(key, client, retries - 1) ) return if force or ts.who_wants == {cs}: # no one else wants this key