Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix test_gc when run sequentially
  • Loading branch information
colesbury committed May 9, 2024
commit 0c0c9b4312e1e2668f1294cfca955355ca4788cb
8 changes: 8 additions & 0 deletions Lib/test/test_gc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,10 @@ def callback(ignored):
junk = []
i = 0
detector = GC_Detector()
if Py_GIL_DISABLED:
# The free-threaded build doesn't have multiple generations, so
# just trigger a GC manually.
gc.collect()
while not detector.gc_happened:
i += 1
if i > 10000:
Expand Down Expand Up @@ -1423,6 +1427,10 @@ def __del__(self):
detector = GC_Detector()
junk = []
i = 0
if Py_GIL_DISABLED:
# The free-threaded build doesn't have multiple generations, so
# just trigger a GC manually.
gc.collect()
while not detector.gc_happened:
i += 1
if i > 10000:
Expand Down