Skip to content

idlelib tests: Fix refleak testing of test_zzdummy - #155393

Open
zware wants to merge 1 commit into
python:mainfrom
zware:idle_refleak_test_fix
Open

idlelib tests: Fix refleak testing of test_zzdummy#155393
zware wants to merge 1 commit into
python:mainfrom
zware:idle_refleak_test_fix

Conversation

@zware

@zware zware commented Aug 8, 2026

Copy link
Copy Markdown
Member

Create a fresh test config for each test run of test_zzdummy.

This prevents a first-run failure in test_zzdummy.ZZDummyTest.test_exists due to what appears to be config pollution caused by test_zzdummy.ZZDummyMixin.test_reload (at least, hacking the failing check from test_exists into tearDown shows test_reload to be the first failure). The failure can be seen on the AMD64 Windows Server 2025 Refleaks builder, but is reproducible on Linux as well. Note that it does not cause the full buildbot run to fail, as the polluting test does not get re-run at the end.

This is the smallest change I could make to fix the refleak run, but I doubt it's ideal :). If you'd rather treat this as a bug report against the test and fix it a better way, please go ahead!

@zware
zware requested a review from terryjreedy as a code owner August 8, 2026 18:06
@zware zware added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir skip issue skip news topic-IDLE needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Aug 8, 2026
@zware
zware requested a review from serhiy-storchaka August 8, 2026 18:06

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check test_zzdummy_user.py -- it can have the same leak.

Comment thread Lib/idlelib/idle_test/test_zzdummy.py Outdated
usercfg = zzdummy.idleConf.userCfg
testcfg = {

make_testcfg = lambda: {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: define a function instead of lambda.

def make_testcfg():

Comment thread Lib/idlelib/idle_test/test_zzdummy.py Outdated
text = cls.text = Text(cls.root)
cls.editor = DummyEditwin(root, text)
zzdummy.idleConf.userCfg = testcfg
zzdummy.idleConf.userCfg = make_testcfg()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do this in setUp() instead of setUpClass().

@terryjreedy

Copy link
Copy Markdown
Member

The changes made a few months ago to test_zzdummy and the creation of a 2nd test file are, I am rather sure, wrong and should be reverted. The new test does not test anything worthwhile, in particular, it does not properly test the new feature it was meant to test. I did not do it yet because a) I discovered this about a month ago when Serhiy contributed about 14 patches that I considered higher priority (along with some other IDLE stuff) to investigate and justify; and b) I was not sure whether any of the rest of the merge needed reversion or modification. So I suggest you find the issue, revert the test changes, and backport, including to 3.15. If you do a clean revert, consider this comment my pre-review and approval.

If there is still a leak, meaning that there was one before the change, fix it. And I approve of Serhiy's two suggestions if still relevant after the reversion. I am off to bed now.

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert last spring's changes and splitting into 2 files. Then fix as needed.

@bedevere-app

bedevere-app Bot commented Aug 9, 2026

Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

… keybindings from user config (pythonGH-28713)"

This reverts part of commit 208195d.
@zware
zware force-pushed the idle_refleak_test_fix branch from c9c2ba3 to 586fd6c Compare August 11, 2026 19:04
@zware

zware commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

I have made the requested changes; please review again.

In particular, this is now strictly a reversion of the Lib/idlelib/idle_test/ changes from GH-28713 as requested.

@bedevere-app

bedevere-app Bot commented Aug 11, 2026

Copy link
Copy Markdown

Thanks for making the requested changes!

@terryjreedy: please review the changes made to this pull request.

@bedevere-app
bedevere-app Bot requested a review from terryjreedy August 11, 2026 19:05
@zware

zware commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

!buildbot Windows.*Refleak

@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @zware for commit 586fd6c 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F155393%2Fmerge

The command will test the builders whose names match following regular expression: Windows.*Refleak

The builders matched are:

  • AMD64 Windows Server 2025 Refleaks PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting change review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip issue skip news tests Tests in the Lib/test dir topic-IDLE type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants