Skip to content

Commit fbc85c1

Browse files
test: Remove flaky no cyclic garbage test (#6817)
The test flakes on 3.14t, and our test suite is not responsible for testing garbage collection details.
1 parent 2b9c102 commit fbc85c1

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

tests/test_serializer.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import gc
21
import re
32
from array import array
43

@@ -184,29 +183,6 @@ def test_max_value_length(body_normalizer):
184183
assert len(result["key"]) == max_value_length
185184

186185

187-
def test_serialize_does_not_leave_cyclic_garbage():
188-
# Applications running with the GC disabled rely on serialize() being
189-
# freed by reference counting alone, so it must not create reference
190-
# cycles.
191-
gc_was_enabled = gc.isenabled()
192-
old_debug_flags = gc.get_debug()
193-
gc.collect()
194-
gc.disable()
195-
try:
196-
serialize({"extra": {"foo": [{"bar": i} for i in range(20)]}})
197-
serialize({"foo": "bar"}, is_vars=True)
198-
199-
gc.set_debug(gc.DEBUG_SAVEALL)
200-
gc.collect()
201-
assert gc.garbage == []
202-
finally:
203-
gc.set_debug(old_debug_flags)
204-
gc.garbage.clear()
205-
gc.collect()
206-
if gc_was_enabled:
207-
gc.enable()
208-
209-
210186
def test_serialize_local_vars():
211187
# This was added to make sure we don't try to iterate over instances of
212188
# custom classes with an __iter__ method due to potential side effects

0 commit comments

Comments
 (0)