-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_idle is leaking references #88147
Comments
See for example: https://buildbot.python.org/all/#/builders/511/builds/10/steps/4/logs/stdio test_idle leaked [684, 684, 684] references, sum=2052 |
Marking this as a release blocker |
The only recently added tests are the 11 in test_sidebar.ShellSidebarTest. Leak testing just these with FAIL: test_menudefs (idlelib.idle_test.test_mainmenu.MainMenuTest) Traceback (most recent call last):
File "f:\dev\3x\lib\idlelib\idle_test\test_mainmenu.py", line 15, in test_menudefs
self.assertEqual(actual, expect)
AssertionError: Lists differ:
['application', 'file', 'edit', 'format', '[47 chars]elp'] !=
['file', 'edit', 'format', 'run', 'shell', [32 chars]elp'] The 'application' menu was by added by a call to macosx.setupApp, which calls overrideRootMenu, in ShellSidebarTest.setUpClass. This call is not needed for this testcase, so the first PR replaces it with a comment referring to this issue. Note: when test_macosc calls setupApp, overrideRootMenu is replaced with a mock. The second execution of ShellSidebarTest.setUpClass failed with ERROR: setUpClass (idlelib.idle_test.test_sidebar.ShellSidebarTest) Traceback (most recent call last):
File "f:\dev\3x\lib\idlelib\idle_test\test_sidebar.py", line 414, in setUpClass
cls.init_shell()
File "f:\dev\3x\lib\idlelib\idle_test\test_sidebar.py", line 429, in init_shell
cls.shell = cls.flist.open_shell()
File "f:\dev\3x\lib\idlelib\pyshell.py", line 334, in open_shell
self.pyshell = PyShell(self)
File "f:\dev\3x\lib\idlelib\pyshell.py", line 890, in __init__
OutputWindow.__init__(self, flist, None, None)
File "f:\dev\3x\lib\idlelib\outwin.py", line 79, in __init__
EditorWindow.__init__(self, *args)
File "f:\dev\3x\lib\idlelib\editor.py", line 342, in __init__
self.update_menu_state('options', '*ode*ontext', 'disabled')
File "f:\dev\3x\lib\idlelib\editor.py", line 488, in update_menu_state
menuitem.entryconfig(index, state=state)
File "f:\dev\3x\lib\tkinter\__init__.py", line 3383, in entryconfigure
return self._configure(('entryconfigure', index), cnf, kw)
File "f:\dev\3x\lib\tkinter\__init__.py", line 1660, in _configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: bad menu entry index "*ode*ontext" One of the things that overrideRootMenu does is to move the option setting item, above the code context item, to the application submenu. I don't understand why this caused the failure above. However, removing the setupApp call fixed this failure also. The first PR does this. With this fix, test_idle runs 6 times with leak report With ShellSidebarTest skipped, the result is only slightly better. |
test_squeezer.ExpandingButtonTest accounts for most of the leak. Yesterday's patch, https://github.com/python/cpython/pull/22682/files, Tal, any idea why these are leaking? |
I will try to investigate today or tomorrow but notice that is very possible that the leak is somewhere else in the interpreter and is just showing in the IDLE tests. |
Taking into account the last time the builder built successully it must have happened in some of these commits: b38b2fa Document importlib.metadata.PackagePath.locate method (GH-25669) |
I checked and reverting commit 15d3861 fixes the leaks. |
Unfortunately given how close are we to the beta release and per our buildbot policy (https://discuss.python.org/t/policy-to-revert-commits-on-buildbot-failure/404) I may need to revert commit 15d3861 to avoid masking other issues. |
Refleaks fixed by 6689e45 |
I was just about to try adding that exact cleanup close after finishing reading emails ;-). Sorry I didn't think of it last night. Glad it worked. The alternative would have been to skip the test case. |
Pablo, many thanks for catching this, analyzing it and finding a fix! Sorry for missing this cleanup in the first place, and moreso for not having being able to look into this when you brought it up. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: