Skip to content

Run Python 3.13 tests for macOS 14 on arm runners.#12357

Merged
altendky merged 4 commits intotrunkfrom
altendky-patch-3
Nov 7, 2024
Merged

Run Python 3.13 tests for macOS 14 on arm runners.#12357
altendky merged 4 commits intotrunkfrom
altendky-patch-3

Conversation

@altendky
Copy link
Member

@altendky altendky commented Nov 6, 2024

Scope and purpose

Fixes #

Add a few words about why this PR is needed and what is its scope.
If the associate ticket(s) fully explain the need you can just refer to it/them.

Add any comments about trade-offs (if any) made in this PR and the reasoning behind them.

Add mentions of things that are not covered here and are planed to be done in separate PRs.

Contributor Checklist:

This process applies to all pull requests - no matter how small.
Have a look at our developer documentation before submitting your Pull Request.

Below is a non-exhaustive list (as a reminder):

  • The title of the PR should describe the changes and starts with the associated issue number, like “#9782 Remove twisted.news. #1234 Brief description”.
  • A release notes news fragment file was create in src/twisted/newsfragments/ (see: Release notes fragments docs.)
  • The automated tests were updated.
  • Once all checks are green, request a review by leaving a comment that contains exactly the string please review.
    Our bot will trigger the review process, by applying the pending review label
    and requesting a review from the Twisted dev team.

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 6, 2024

CodSpeed Performance Report

Merging #12357 will not alter performance

Comparing altendky-patch-3 (2b88f27) with trunk (4711c34)

Summary

✅ 25 untouched benchmarks

@altendky altendky marked this pull request as ready for review November 6, 2024 23:09
@altendky
Copy link
Member Author

altendky commented Nov 6, 2024

@adiroiban, looks like you win probably. https://github.com/twisted/twisted/actions/runs/11713225981/job/32625578908?pr=12357 macos-14 is ok and macos-15 is failing consistently.

@glyph
Copy link
Member

glyph commented Nov 6, 2024

@altendky It looks like all the tests are UDP-on-localhost, failing with routing errors?

I think that this may have to do with the (new in Sequoia?) "local network" permission?

@glyph
Copy link
Member

glyph commented Nov 6, 2024

Okay, neat, if I do this:

image

I can reproduce this error immediately, and it looks just the same.

Not sure how we can manipulate the TCC database in github actions.

@altendky
Copy link
Member Author

altendky commented Nov 6, 2024

I'd heard a thing about some changes but I don't use macOS personally and hadn't heard any details about it. So I agree with your guess, for whatever little that's worth. :]

This PR gets testing going on macOS ARM at least. Bumping to 15 could be good when the necessary setup adjustments are figured out. Or maybe 'we' are supposed to start requesting permissions?

@glyph
Copy link
Member

glyph commented Nov 7, 2024

I am not sure how we could request these permissions from the command line. Apple intentionally makes this difficult, for obvious reasons, and I cannot find anyone writing about how to do this with Github Actions specifically: https://apple.stackexchange.com/questions/472592/grant-permissions-from-the-command-line

@glyph
Copy link
Member

glyph commented Nov 7, 2024

So, the problem here is that we are joining an arbitrary local-network multicast group, which actually blasts stuff out to the ethernet port, or at least could do that to the address it's connected to, which is why we need "local network" permission, which "localhost" normally wouldn't require. I started wondering if I could port this to IPv6 to use its loopback address which doesn't exist in IPv4, but then discovered that we super do not support IPv6 multicast.

Not sure what the right way forward is. If someone wants to ask some github actions support folks that might be a good next step, but I don't know how to reach them.

Testing on macOS 14 is definitely a step up though, so for sure not a blocker here.

@glyph
Copy link
Member

glyph commented Nov 7, 2024

Just leaving this here for future reference; I tried to adjust twisted/internet/udp.py to do https://stackoverflow.com/questions/3183194/send-and-receive-ipv6-link-local-multicast-udp-datagrams-in-python but messed it up somehow, so I should try again starting from there as an example.

@adiroiban adiroiban changed the title switch latest python macos to use macos arm runners Run Python 3.13 tests for macOS 14 on arm runners. Nov 7, 2024
Copy link
Member

@adiroiban adiroiban left a comment

Choose a reason for hiding this comment

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

Thanks for the update and the investigation here.

I think that we can merge this.

What we can do for macos15 is to skip those tests ... some tests are just hard to setup on public testing infrastructure

As long as we still run those tests on macos13 or macos14 it should be ok. I guess that the low level UDP multicast code in macOS is the same .. in macOS15 it's just a firewall change

@altendky
Copy link
Member Author

altendky commented Nov 7, 2024

What we can do for macos15 is to skip those tests ... some tests are just hard to setup on public testing infrastructure

caveat that that is a temporary 'solution' that's good until macos15 is the oldest. looks like that will be ballpark two years.

@altendky altendky merged commit 8c74b06 into trunk Nov 7, 2024
@altendky altendky deleted the altendky-patch-3 branch November 7, 2024 12:37
@glyph
Copy link
Member

glyph commented Nov 7, 2024

What we can do for macos15 is to skip those tests ... some tests are just hard to setup on public testing infrastructure

caveat that that is a temporary 'solution' that's good until macos15 is the oldest. looks like that will be ballpark two years.

I think that skipping in the specific case of macOS 15 is a good starting point here. When we try to add 16, then we will see the issue again which will prompt us to fix that, and we will have prompts at both 16 and 17 before 15 disappears :). If we implement #6597 then we may be able to sidestep the need for the permission, and get more or less equivalent coverage, only skipping IPv4.

@glyph
Copy link
Member

glyph commented Nov 7, 2024

I filed a ticket upstream for this. actions/runner-images#10924

@glyph
Copy link
Member

glyph commented Nov 13, 2024

@altendky I sneakily put in a capability-detection check in #12360 which should make it possible to enable macOS 15 without any further work. We won't be testing multicast on macOS unless github grants that permission, but I think that's fine; the API doesn't actually differ between platforms, so there's no additional code to cover.

@altendky
Copy link
Member Author

#12363

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants