Bug 2203920 - python-uvloop fails to build with Python 3.12: AssertionError: 8 != -1
Summary: python-uvloop fails to build with Python 3.12: AssertionError: 8 != -1
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-uvloop
Version: 39
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Paul Wouters
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.12 2220097 2220131 2220551 2226364
TreeView+ depends on / blocked
 
Reported: 2023-05-15 15:14 UTC by Tomáš Hrnčiar
Modified: 2023-10-04 17:15 UTC (History)
6 users (show)

Fixed In Version: python-uvloop-0.17.0-7.fc40 python-uvloop-0.17.0-7.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-25 20:58:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github MagicStack uvloop issues 547 0 None open Add support for Python 3.12 to Uvloop 2023-09-08 00:10:46 UTC

Description Tomáš Hrnčiar 2023-05-15 15:14:10 UTC
python-uvloop fails to build with Python 3.12.0a7.


======================================================================
ERROR: test_process_double_close (tests.test_process.Test_UV_Process.test_process_double_close)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_process.py", line 867, in test_process_double_close
    subprocess.run([sys.executable, '-c', script], check=True)
  File "/usr/lib64/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-c', '\nimport os\nimport sys\nfrom unittest import mock\n\nimport asyncio\n\npipes = []\noriginal_os_pipe = os.pipe\ndef log_pipes():\n    pipe = original_os_pipe()\n    pipes.append(pipe)\n    return pipe\n\ndups = []\noriginal_os_dup = os.dup\ndef log_dups(*args, **kwargs):\n    dup = original_os_dup(*args, **kwargs)\n    dups.append(dup)\n    return dup\n\nwith mock.patch(\n    "os.close", wraps=os.close\n) as os_close, mock.patch(\n    "os.pipe", new=log_pipes\n), mock.patch(\n    "os.dup", new=log_dups\n):\n    import uvloop\n\n\nasync def test():\n    proc = await asyncio.create_subprocess_exec(\n        sys.executable, "-c", "pass"\n    )\n    await proc.communicate()\n\nuvloop.install()\nasyncio.run(test())\n\nstdin, stdout, stderr = dups\n(r, w), = pipes\nassert os_close.mock_calls == [\n    mock.call(w),\n    mock.call(r),\n    mock.call(stderr),\n    mock.call(stdout),\n    mock.call(stdin),\n]\n']' returned non-zero exit status 1.

======================================================================
ERROR: test_aiohttp_graceful_shutdown (tests.test_aiohttp.Test_AIO_AioHTTP.test_aiohttp_graceful_shutdown)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.12/asyncio/tasks.py", line 477, in wait_for
    return await fut
           ^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/aiohttp/web_runner.py", line 293, in cleanup
    await site.stop()
  File "/usr/lib64/python3.12/site-packages/aiohttp/web_runner.py", line 75, in stop
    await self._server.wait_closed()
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 384, in wait_closed
    await waiter
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_aiohttp.py", line 101, in test_aiohttp_graceful_shutdown
    self.loop.run_until_complete(stop())
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_aiohttp.py", line 93, in stop
    await asyncio.wait_for(runner.cleanup(), timeout=0.1)
  File "/usr/lib64/python3.12/asyncio/tasks.py", line 476, in wait_for
    async with timeouts.timeout(timeout):
  File "/usr/lib64/python3.12/asyncio/timeouts.py", line 111, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

======================================================================
FAIL: test_create_unix_server_1 (tests.test_unix.Test_AIO_Unix.test_create_unix_server_1) (func='start_unix_server(host, port)')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_unix.py", line 129, in test_create_unix_server_1
    self.loop.run_until_complete(start_server())
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_unix.py", line 86, in start_server
    self.assertEqual(srv_sock.fileno(), -1)
AssertionError: 6 != -1

======================================================================
FAIL: test_create_unix_server_1 (tests.test_unix.Test_AIO_Unix.test_create_unix_server_1) (func='start_unix_server(sock)')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_unix.py", line 133, in test_create_unix_server_1
    self.loop.run_until_complete(start_server_sock(
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_unix.py", line 121, in start_server_sock
    self.assertEqual(srv_sock.fileno(), -1)
AssertionError: 6 != -1

======================================================================
FAIL: test_create_unix_server_1 (tests.test_unix.Test_AIO_Unix.test_create_unix_server_1) (func='start_server(sock)')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_unix.py", line 141, in test_create_unix_server_1
    self.loop.run_until_complete(start_server_sock(
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_unix.py", line 121, in start_server_sock
    self.assertEqual(srv_sock.fileno(), -1)
AssertionError: 6 != -1

======================================================================
FAIL: test_create_server_1 (tests.test_tcp.Test_AIO_TCP.test_create_server_1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_tcp.py", line 177, in test_create_server_1
    self.loop.run_until_complete(start_server())
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_tcp.py", line 138, in start_server
    self.assertEqual(srv_sock.fileno(), -1)
AssertionError: 8 != -1

======================================================================
FAIL: test_create_server_3 (tests.test_tcp.Test_AIO_TCP.test_create_server_3)
check ephemeral port can be used
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_tcp.py", line 214, in test_create_server_3
    self.loop.run_until_complete(start_server_ephemeral_ports())
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_tcp.py", line 210, in start_server_ephemeral_ports
    self.assertEqual(srv_sock.fileno(), -1)
AssertionError: 8 != -1

----------------------------------------------------------------------
Ran 506 tests in 75.357s

FAILED (failures=5, errors=2, skipped=33)

https://docs.python.org/3.12/whatsnew/3.12.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-rawhide-x86_64/05919490-python-uvloop/

For all our attempts to build python-uvloop with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/python-uvloop/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.12:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/

Let us know here if you have any questions.

Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Fedora Release Engineering 2023-08-16 07:14:15 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.

Comment 2 Fedora Admin user for bugzilla script actions 2023-09-05 00:53:01 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 3 Fedora Admin user for bugzilla script actions 2023-09-06 00:44:19 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 4 Fedora Update System 2023-09-25 20:57:00 UTC
FEDORA-2023-5967d3ecde has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-5967d3ecde

Comment 5 Fedora Update System 2023-09-25 20:58:43 UTC
FEDORA-2023-5967d3ecde has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 Fedora Update System 2023-09-26 03:39:29 UTC
FEDORA-2023-ae19f823c9 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-ae19f823c9

Comment 7 Fedora Update System 2023-09-27 01:25:16 UTC
FEDORA-2023-ae19f823c9 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-ae19f823c9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-ae19f823c9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2023-10-04 17:15:19 UTC
FEDORA-2023-ae19f823c9 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.