allow test to work on implementations not using ref-counting (closes #22265)
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 1bf6c53..5da4a6f 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -808,6 +808,7 @@
         it = islice(it, 1)
         self.assertIsNotNone(wr())
         list(it) # exhaust the iterator
+        test_support.gc_collect()
         self.assertIsNone(wr())
 
     def test_takewhile(self):