Skip to content

Commit c7af2d4

Browse files
committed
Regression: test_weakref_cache
1 parent 2ff681c commit c7af2d4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

distributed/tests/test_spill.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import gc
34
import logging
45
import os
56
import uuid
@@ -337,6 +338,9 @@ def test_weakref_cache(tmpdir, cls, expect_cached, size):
337338
# the same id as a deleted one
338339
id_x = x.id
339340
del x
341+
# Surprisingly, even on CPython this is needed to ensure that the object is garbage
342+
# collected, even if there are no obvious circular references going on
343+
gc.collect()
340344

341345
if size < 100:
342346
buf["y"]

0 commit comments

Comments
 (0)