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 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")