Bug 2275066 - python-mirakuru fails to build with Python 3.13: AssertionError: The test process should be running. & assert SAMPLE_DAEMON_PATH in ps_aux()
Summary: python-mirakuru fails to build with Python 3.13: AssertionError: The test pro...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-mirakuru
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mikel Olasagasti Uranga
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2024-04-15 08:09 UTC by Karolina Surma
Modified: 2024-04-15 08:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2024-04-15 08:09:36 UTC
python-mirakuru fails to build with Python 3.13.0a6.


=================================== FAILURES ===================================
_____________________________ test_forgotten_stop ______________________________

    def test_forgotten_stop() -> None:
        """Test if SimpleExecutor subprocess is killed after an instance is deleted.
    
        Existence can end because of context scope end or by calling 'del'.
        If someone forgot to stop() or kill() subprocess it should be killed
        by default on instance cleanup.
        """
        mark = str(uuid.uuid1())
        # We cannot simply do `sleep 300 #<our-uuid>` in a shell because in that
        # case bash (default shell on some systems) does `execve` without cloning
        # itself - that means there will be no process with commandline like:
        # '/bin/sh -c sleep 300 && true #<our-uuid>' - instead that process would
        # get substituted with 'sleep 300' and the marked commandline would be
        # overwritten.
        # Injecting some flow control (`&&`) forces bash to fork properly.
        marked_command = f"sleep 300 && true #{mark!s}"
        executor = SimpleExecutor(marked_command, shell=True)
        executor.start()
        assert executor.running() is True
>       assert mark in ps_aux(), "The test process should be running."
E       AssertionError: The test process should be running.
E       assert '288df03c-f906-11ee-991a-294ab6448b30' in "b'USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\\nmockbui+       1  0.0  0.0  16308  365...        R    19:52   0:00 ps aux -w\\nmockbui+     313  0.0  0.0   2968  1920 ?        S    19:52   0:00 sleep 300\\n'"
E        +  where "b'USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\\nmockbui+       1  0.0  0.0  16308  365...        R    19:52   0:00 ps aux -w\\nmockbui+     313  0.0  0.0   2968  1920 ?        S    19:52   0:00 sleep 300\\n'" = ps_aux()

tests/executors/test_executor.py:175: AssertionError
_____________________________ test_daemons_killing _____________________________

    def test_daemons_killing() -> None:
        """Test if all subprocesses of SimpleExecutor can be killed.
    
        The most problematic subprocesses are daemons or other services that
        change the process group ID. This test verifies that daemon process
        is killed after executor's kill().
        """
        executor = SimpleExecutor(("python", SAMPLE_DAEMON_PATH), shell=True)
        executor.start()
        time.sleep(2)
        assert (
            executor.running() is not True
        ), "Executor should not have subprocess running as it started a daemon."
    
>       assert SAMPLE_DAEMON_PATH in ps_aux()
E       assert '/builddir/build/BUILD/mirakuru-2.5.2/tests/sample_daemon.py' in "b'USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\\nmockbui+       1  0.0  0.0  16308  365...irakuru-2.5.2/tests/sample_daemon.p\\nmockbui+     332  0.0  0.0   6852  3968 ?        R    19:52   0:00 ps aux -w\\n'"
E        +  where "b'USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\\nmockbui+       1  0.0  0.0  16308  365...irakuru-2.5.2/tests/sample_daemon.p\\nmockbui+     332  0.0  0.0   6852  3968 ?        R    19:52   0:00 ps aux -w\\n'" = ps_aux()

tests/executors/test_executor_kill.py:70: AssertionError
=========================== short test summary info ============================
FAILED tests/executors/test_executor.py::test_forgotten_stop - AssertionError...
FAILED tests/executors/test_executor_kill.py::test_daemons_killing - assert '...
============ 2 failed, 57 passed, 1 deselected in 74.13s (0:01:14) =============

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/07302908-python-mirakuru/

For all our attempts to build python-mirakuru with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-mirakuru/

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.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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.


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