From 0fa97c8698cc7bd5d3437f95f294e5c3ba8c79e3 Mon Sep 17 00:00:00 2001 From: stepan Date: Mon, 26 Jan 2026 11:24:22 +0100 Subject: [PATCH 1/2] Run GC in test support _unlink amd _rmdir on Windows to make sure all handles are closed --- graalpython/lib-python/3/test/support/os_helper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/graalpython/lib-python/3/test/support/os_helper.py b/graalpython/lib-python/3/test/support/os_helper.py index d6422ab8a4..959daef2d0 100644 --- a/graalpython/lib-python/3/test/support/os_helper.py +++ b/graalpython/lib-python/3/test/support/os_helper.py @@ -332,6 +332,8 @@ def unlink(filename): if sys.platform.startswith("win"): def _waitfor(func, pathname, waitall=False): + # GraalPy change: run GC to ensure all handles are closed + support.gc_collect() # Perform the operation func(pathname) # Now setup the wait loop @@ -348,7 +350,9 @@ def _waitfor(func, pathname, waitall=False): # required when contention occurs. timeout = 0.001 # GraalPy change: increase timeout to account for our overloaded machines + # and run GC to ensure all handles are closed while timeout < 120.0: + support.gc_collect() # Note we are only testing for the existence of the file(s) in # the contents of the directory regardless of any security or # access rights. If we have made it this far, we have sufficient From 38906bcca10fd64cc339e0d45375c27ec5881b7b Mon Sep 17 00:00:00 2001 From: stepan Date: Mon, 26 Jan 2026 16:02:43 +0100 Subject: [PATCH 2/2] Temporarily ignore the problematic part of test_xml_etree.test_iterparse --- graalpython/lib-python/3/test/test_xml_etree.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/graalpython/lib-python/3/test/test_xml_etree.py b/graalpython/lib-python/3/test/test_xml_etree.py index f8c2e5ccaa..aa33d39f60 100644 --- a/graalpython/lib-python/3/test/test_xml_etree.py +++ b/graalpython/lib-python/3/test/test_xml_etree.py @@ -646,9 +646,10 @@ def test_iterparse(self): del cm, it # Not exhausting the iterator still closes the resource (bpo-43292) - with warnings_helper.check_no_resource_warning(self): - it = iterparse(TESTFN) - del it + # GraalPy change: ignored, see GR-72687 + #with warnings_helper.check_no_resource_warning(self): + # it = iterparse(TESTFN) + # del it with self.assertRaises(FileNotFoundError): iterparse("nonexistent")