-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Description
In #132947 (comment) and the subsequent investigation, we learned that the recent changes to importlib.metadata cause ResourceWarnings
to be emitted, causing select buildbot runs to fail.
After extensive investigation and code bisection, the ultimate cause is still not known. The problem has been temporarily remedied by bypassing a test that triggers the failure, but a more permanent solution is needed.
Here's a summary of the situation:
-
The resource warning is caused by an open handle on the
test_packages_distributions_example2
cpython/Lib/test/test_importlib/metadata/test_main.py
Lines 350 to 356 in 3706ef6
def test_packages_distributions_example2(self): """ Test packages_distributions on a wheel built by trampolim. """ self._fixture_on_path('example2-1.0.0-py3-none-any.whl') assert packages_distributions()['example2'] == ['example2'] That seems to implicate something holding onto that zip file, which gets added to
sys.path
during fixture setup. -
The resource warning isn't triggered until
test_importlib
completes. -
The warning is only emitted in a few buildbots, but not on local tests, GHA tests, or other buidlbots.
-
The changes in
importlib.metadata.__init__
seem to be implicated, but even after removing nearly every change in that file, the problem remained.
Testing using buildbot is slow and tedious. Probably the next best step is to find a way to replicate the issue in a development environment, either by getting access to a buildbot image or by creating a comparable image that replicates the issue.