Skip to content
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

gh-61698: Use launchctl to detect macOS window manager in tests #118390

Merged

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Apr 29, 2024

@erlend-aasland erlend-aasland added skip news needs backport to 3.12 bug and security fixes tests Tests in the Lib/test dir labels Apr 29, 2024
@erlend-aasland erlend-aasland marked this pull request as ready for review April 29, 2024 14:13
Copy link
Contributor

@ronaldoussoren ronaldoussoren left a comment

Choose a reason for hiding this comment

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

LGTM.

I'd definitely check if it works on our buildbots before committing this though, with some luck those have a setup that claims to be an Aqua session but isn't.

@erlend-aasland erlend-aasland added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 29, 2024
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit 37eec0b 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 29, 2024
@erlend-aasland
Copy link
Contributor Author

Unfortunately, the sessions on the macOS CIs claim to be Aqua, so this won't work.

@erlend-aasland
Copy link
Contributor Author

The ARM64 MacOS M1 Refleaks NoGIL PR buildbot correctly skips the tests, though.

@erlend-aasland
Copy link
Contributor Author

OTOH, we could fix (or skip) the failing tkinter tests and go on with this PR.

@erlend-aasland
Copy link
Contributor Author

OTOH, we could fix (or skip) the failing tkinter tests and go on with this PR.

@ned-deily, @ronaldoussoren: what do you think?

@ned-deily
Copy link
Member

ned-deily commented Aug 24, 2024

Thanks for following up on this issue, @erlend-aasland and @ronaldoussoren. It looks like this change will generally do the right thing more of the times than the previous check, i.e. it is less conservative and allows GUI tests to run in additional environments (like non-framework builds) but still guards against the worst case. I verified that it works back to 10.9 and also verified that a check is still needed: trying to run the gui tests, like test_ttk, through an ssh connection to a Mac with a current version of macOS and Tk 8.6.x without a logged-in console can cause the test process to hang and grow in size. With either the current or this new check, that doesn't happen. One could argue that Tk should handle this but we should guard against it in any case.

@erlend-aasland
Copy link
Contributor Author

Thanks for the reviews, @ned-deily and @ronaldoussoren. Before landing, I'll create issues for the failing tests and temporarily skipping them on macOS. I'll get back on this later today.

@erlend-aasland
Copy link
Contributor Author

The failing1 test is already recorded by Ronald in #86673 (comment), coupled with suggested solutions.

Footnotes

  1. AFAICS, there is only one failing tkinter test

@smontanaro
Copy link
Contributor

Can this be merged? I've been running with it applied for a while with no problems. (Would be nice if it could be backported as well.)

@erlend-aasland
Copy link
Contributor Author

Can this be merged? I've been running with it applied for a while with no problems. (Would be nice if it could be backported as well.)

No, it breaks CI. See my earlier comment: #118390 (comment)

@smontanaro
Copy link
Contributor

Can this be merged? I've been running with it applied for a while with no problems. (Would be nice if it could be backported as well.)

No, it breaks CI. See my earlier comment: #118390 (comment)

Hmmm... I suppose there's no way to use an in-memory framebuffer as the display device? (Does seem like a lot of work for CI unless someone else has already done the hard work.)

@erlend-aasland
Copy link
Contributor Author

Hmmm... I suppose there's no way to use an in-memory framebuffer as the display device? (Does seem like a lot of work for CI unless someone else has already done the hard work.)

I merged a variant of Serhiy's suggesting for one of the failing Tk tests and synced this PR with main. Let's see how it fares now.

@erlend-aasland
Copy link
Contributor Author

Well, test.test_ttk.test_widgets.ComboboxTest.test_identify still fails. Let's fix that as well.

@erlend-aasland
Copy link
Contributor Author

All right, let's land this!

@erlend-aasland erlend-aasland merged commit ce740d4 into python:main Oct 13, 2024
33 checks passed
@erlend-aasland erlend-aasland deleted the macos/fix-window-manager-check branch October 13, 2024 08:22
@miss-islington-app

This comment has been minimized.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 13, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 13, 2024
@bedevere-app
Copy link

bedevere-app bot commented Oct 13, 2024

GH-125392 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Oct 13, 2024
@bedevere-app
Copy link

bedevere-app bot commented Oct 13, 2024

GH-125393 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Oct 13, 2024
erlend-aasland added a commit that referenced this pull request Oct 13, 2024
erlend-aasland added a commit that referenced this pull request Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants