Should I expect all 3.8-3.10 tests to pass on M1 Mac?

When I fetched earlier today, I noticed updates to the 3.8, 3.9 and 3.10 branches. I’d only recently built them to make them available to tox for cherry-picker unit tests. I honestly don’t recall if I ran make test first or just make altinstall when I first built them a couple weeks ago.

Today, I pulled then ran

git clean -fdx
make test

and get failures for test_asyncio on all three versions.

This is on an up-to-date (Sonoma 14.3.1) M1 Macbook Pro. Is this failure to be expected? I assume the updates (at least for 3.8 & 3.9) were security fixes. I don’t know if they are old enough to have ever been tested on M1 Macs when they were still current. I would think 3.10 should work fine on that platform though.

What test failures do you get?

On my M3 (same OS version) test_socket always fails with one issue due to the way DNS is set up for me (life’s too short to dig in deeper), for all versions up to main:

test test_socket failed -- Traceback (most recent call last):
  File "/Users/guido/3.10/Lib/test/", line 1028, in test_host_resolution_bad_address
    with self.assertRaises(OSError, msg=addr):
AssertionError: OSError not raised : ::1q

I also get test failures for test_peg_generator, apparently because distutils is being deprecated (maybe there’s a dependency on setuptools here?); several errors like this:

Traceback (most recent call last):
  File "/Users/guido/3.10/Lib/test/test_peg_generator/", line 357, in test_with_stmt_with_paren
    self.run_test(grammar_source, test_source)
  File "/Users/guido/3.10/Lib/test/test_peg_generator/", line 96, in run_test
  File "/Users/guido/3.10/Lib/test/test_peg_generator/", line 93, in build_extension
    generate_parser_c_extension(grammar, Path(self.tmp_path))
  File "/Users/guido/3.10/Tools/peg_generator/pegen/", line 104, in generate_parser_c_extension
    compile_c_extension(str(source), build_dir=str(path))
  File "/Users/guido/3.10/Tools/peg_generator/pegen/", line 53, in compile_c_extension
    from import fixup_build_ext  # type: ignore
ModuleNotFoundError: No module named 'distutils.tests'

Everything else passes in 3.10 (I haven’t tested earlier versions).

Apple Silicon (“M1”) Macs were first supported in 3.8.10 and 3.9.1, and from the initial release of 3.10. They do get tested on both kinds of Macs but there are probably some test failures on either kind of Mac. Be aware that 3.8 through 3.10 do not have the benefit of the configure and build improvements regarding third-party libraries available in 3.11+; the devguide has the details.

That one has failed for me for a long time. I did actually dig into it several years ago, but didn’t come up with a solution and eventually gave up. I can’t remember now whether there was a GitHub [1] issue on this.

It still bugs me, but not enough to expend time on it.

  1. or Roundup! ↩︎

The test currently failing for me is test_asyncio. Seems to always be ConnectionResetError:

ERROR: test_create_ssl_connection (test.test_asyncio.test_events.KqueueEventLoopTests)
Traceback (most recent call last):
  File "/Users/skip/src/python/py3.9/Lib/test/test_asyncio/", line 617, in test_create_ssl_connection
    self._test_create_ssl_connection(httpd, create_connection,
  File "/Users/skip/src/python/py3.9/Lib/test/test_asyncio/", line 605, in _test_create_ssl_connection
    self._basetest_create_ssl_connection(conn_fut, check_sockname,
  File "/Users/skip/src/python/py3.9/Lib/test/test_asyncio/", line 564, in _basetest_create_ssl_connection
    tr, pr = self.loop.run_until_complete(connection_fut)
  File "/Users/skip/src/python/py3.9/Lib/asyncio/", line 647, in run_until_complete
    return future.result()
  File "/Users/skip/src/python/py3.9/Lib/asyncio/", line 1090, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "/Users/skip/src/python/py3.9/Lib/asyncio/", line 1120, in _create_connection_transport
    await waiter

The disutils.test import is a setuptools issue as was explained to me in GitHub:

Deleting the local install of that version solved the problem. I guess setuptools is dragged in during install and some recent(?) version of it broke things.

Oh, SSL. I have no idea.

Ah, that ConnectionResetError failure in test_asyncio is being seen with 3.8 and 3.9 on one of the macOS buildbots, for example, here. There has been some speculation that it has to do with the use of OpenSSL 3.x on that buildbot which may not be fully supported on older releases. You could try building with the now-EOLed OpenSSL 1.1.1 which was what was in use when 3.8 and 3.9 were still fully supported; Homebrew and MacPorts still provide binaries for that version, as well. The 3.8 through 3.10 recipe in the devguide can be used while replacing openssl@3.0 with openssl@1.1. I believe that this buildbot failure is on the resident developers list of things to look at but may not have bubbled to the top yet. I’ve tried to reproduce the failure locally but without success so far.

@smontanaro, your Mac is pretty special!
On the 3.10 and 3.9 buildbots, this test has been failing for some time on one specific machine, but couldn’t be reproduced elsewhere. @ambv looked pretty deeply into it but didn’t find the cause.