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

On riscv64 some unit tests fail #403

Open
xypron opened this issue Apr 2, 2024 · 0 comments
Open

On riscv64 some unit tests fail #403

xypron opened this issue Apr 2, 2024 · 0 comments

Comments

@xypron
Copy link
Contributor

xypron commented Apr 2, 2024

On riscv64 some unit tests fail

(Building on riscv64 requires -fomit-framepointer.)

(myenv) user@venus:~/workspace/greenlet$ pytest
=============================================================================== test session starts ===============================================================================
platform linux -- Python 3.12.2, pytest-7.4.4, pluggy-1.4.0
rootdir: /home/user/workspace/greenlet
collected 139 items                                                                                                                                                               

src/greenlet/tests/test_contextvars.py .........s                                                                                                                           [  7%]
src/greenlet/tests/test_cpp.py .FFFF                                                                                                                                        [ 10%]
src/greenlet/tests/test_extension_interface.py ...........                                                                                                                  [ 18%]
src/greenlet/tests/test_gc.py ....                                                                                                                                          [ 21%]
src/greenlet/tests/test_generator.py .                                                                                                                                      [ 22%]
src/greenlet/tests/test_generator_nested.py .....                                                                                                                           [ 25%]
src/greenlet/tests/test_greenlet.py ...F.........................................................F.FFFFF                                                                    [ 74%]
src/greenlet/tests/test_greenlet_trash.py .                                                                                                                                 [ 75%]
src/greenlet/tests/test_leaks.py ............                                                                                                                               [ 84%]
src/greenlet/tests/test_stack_saved.py .                                                                                                                                    [ 84%]
src/greenlet/tests/test_throw.py .......                                                                                                                                    [ 89%]
src/greenlet/tests/test_tracing.py ..........                                                                                                                               [ 97%]
src/greenlet/tests/test_version.py .                                                                                                                                        [ 97%]
src/greenlet/tests/test_weakref.py ...                                                                                                                                      [100%]

==================================================================================== FAILURES =====================================================================================
______________________________________________________________ CPPTests.test_unhandled_exception_in_greenlet_aborts _______________________________________________________________

self = <greenlet.tests.test_cpp.CPPTests testMethod=test_unhandled_exception_in_greenlet_aborts>

    def test_unhandled_exception_in_greenlet_aborts(self):
        # verify that unhandled throw called in greenlet aborts too
>       self._do_test_unhandled_exception('run_unhandled_exception_in_greenlet_aborts')

src/greenlet/tests/test_cpp.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/greenlet/tests/test_cpp.py:40: in _do_test_unhandled_exception
    self.assertIn(ex.returncode, expected_exit)
E   AssertionError: 1 not found in (-6, -11)
_________________________________________________________________ CPPTests.test_unhandled_nonstd_exception_aborts _________________________________________________________________

self = <greenlet.tests.test_cpp.CPPTests testMethod=test_unhandled_nonstd_exception_aborts>

    def test_unhandled_nonstd_exception_aborts(self):
        # verify that plain unhandled throw aborts
>       self._do_test_unhandled_exception(_test_extension_cpp.test_exception_throw_nonstd)

src/greenlet/tests/test_cpp.py:47: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/greenlet/tests/test_cpp.py:40: in _do_test_unhandled_exception
    self.assertIn(ex.returncode, expected_exit)
E   AssertionError: 1 not found in (-6, -11)
__________________________________________________________________ CPPTests.test_unhandled_std_exception_aborts ___________________________________________________________________

self = <greenlet.tests.test_cpp.CPPTests testMethod=test_unhandled_std_exception_aborts>

    def test_unhandled_std_exception_aborts(self):
        # verify that plain unhandled throw aborts
>       self._do_test_unhandled_exception(_test_extension_cpp.test_exception_throw_std)

src/greenlet/tests/test_cpp.py:51: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/greenlet/tests/test_cpp.py:40: in _do_test_unhandled_exception
    self.assertIn(ex.returncode, expected_exit)
E   AssertionError: 1 not found in (-6, -11)
________________________________________________________ CPPTests.test_unhandled_std_exception_as_greenlet_function_aborts ________________________________________________________

self = <greenlet.tests.test_cpp.CPPTests testMethod=test_unhandled_std_exception_as_greenlet_function_aborts>

    @unittest.skipIf(WIN, "XXX: This does not crash on Windows")
    # Meaning the exception is getting lost somewhere...
    def test_unhandled_std_exception_as_greenlet_function_aborts(self):
        # verify that plain unhandled throw aborts
>       output = self._do_test_unhandled_exception('run_as_greenlet_target')

src/greenlet/tests/test_cpp.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/greenlet/tests/test_cpp.py:40: in _do_test_unhandled_exception
    self.assertIn(ex.returncode, expected_exit)
E   AssertionError: 1 not found in (-6, -11)
___________________________________________________________ TestGreenlet.test_dealloc_catches_GreenletExit_throws_other ___________________________________________________________

self = <greenlet.tests.test_greenlet.TestGreenlet testMethod=test_dealloc_catches_GreenletExit_throws_other>

    def test_dealloc_catches_GreenletExit_throws_other(self):
        def run():
            try:
                greenlet.getcurrent().parent.switch()
            except greenlet.GreenletExit:
                raise SomeError from None
    
        g = RawGreenlet(run)
        g.switch()
        # Destroying the only reference to the greenlet causes it
        # to get GreenletExit; when it in turn raises, even though we're the parent
        # we don't get the exception, it just gets printed.
        # When we run on 3.8 only, we can use sys.unraisablehook
        oldstderr = sys.stderr
        try:
            from cStringIO import StringIO
        except ImportError:
            from io import StringIO
        stderr = sys.stderr = StringIO()
        try:
            del g
        finally:
            sys.stderr = oldstderr
    
        v = stderr.getvalue()
>       self.assertIn("Exception", v)
E       AssertionError: 'Exception' not found in ''

src/greenlet/tests/test_greenlet.py:221: AssertionError
___________________________________________________________ TestBrokenGreenlets.test_failed_to_slp_switch_into_running ____________________________________________________________

self = <greenlet.tests.test_greenlet.TestBrokenGreenlets testMethod=test_failed_to_slp_switch_into_running>

    def test_failed_to_slp_switch_into_running(self):
>       ex = self.assertScriptRaises('fail_slp_switch.py')

src/greenlet/tests/test_greenlet.py:1245: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/greenlet/tests/__init__.py:236: in assertScriptRaises
    self.assertIn(exc.exception.returncode, exitcodes)
E   AssertionError: 1 not found in (-6, -11)
____________________________________________________ TestBrokenGreenlets.test_reentrant_switch_GreenletAlreadyStartedInPython _____________________________________________________

self = <greenlet.tests.test_greenlet.TestBrokenGreenlets testMethod=test_reentrant_switch_GreenletAlreadyStartedInPython>

    def test_reentrant_switch_GreenletAlreadyStartedInPython(self):
>       output = self.run_script('fail_initialstub_already_started.py')

src/greenlet/tests/test_greenlet.py:1288: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/greenlet/tests/__init__.py:213: in run_script
    return subprocess.check_output([sys.executable, script],
/usr/lib/python3.12/subprocess.py:466: in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

input = None, capture_output = False, timeout = None, check = True
popenargs = (['/usr/bin/python3', '/home/user/workspace/greenlet/src/greenlet/tests/fail_initialstub_already_started.py'],)
kwargs = {'encoding': 'utf-8', 'stderr': -2, 'stdout': -1}, process = <Popen: returncode: 1 args: ['/usr/bin/python3', '/home/user/workspace/gree...>
stdout = 'Traceback (most recent call last):\n  File "/home/user/workspace/greenlet/src/greenlet/tests/fail_initialstub_already_started.py", line 5, in <module>\n    import greenlet\nModuleNotFoundError: No module named \'greenlet\'\n'
stderr = None, retcode = 1

    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
    
        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['/usr/bin/python3', '/home/user/workspace/greenlet/src/greenlet/tests/fail_initialstub_already_started.py']' returned non-zero exit status 1.

/usr/lib/python3.12/subprocess.py:571: CalledProcessError
------------------------------------------------------------------------------ Captured stdout call -------------------------------------------------------------------------------
-----
Failed to run script /home/user/workspace/greenlet/src/greenlet/tests/fail_initialstub_already_started.py
~~~~~
Traceback (most recent call last):
  File "/home/user/workspace/greenlet/src/greenlet/tests/fail_initialstub_already_started.py", line 5, in <module>
    import greenlet
ModuleNotFoundError: No module named 'greenlet'

------
_________________________________________________________ TestBrokenGreenlets.test_reentrant_switch_run_callable_has_del __________________________________________________________

self = <greenlet.tests.test_greenlet.TestBrokenGreenlets testMethod=test_reentrant_switch_run_callable_has_del>

    def test_reentrant_switch_run_callable_has_del(self):
>       output = self.run_script('fail_clearing_run_switches.py')

src/greenlet/tests/test_greenlet.py:1300: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/greenlet/tests/__init__.py:213: in run_script
    return subprocess.check_output([sys.executable, script],
/usr/lib/python3.12/subprocess.py:466: in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

input = None, capture_output = False, timeout = None, check = True
popenargs = (['/usr/bin/python3', '/home/user/workspace/greenlet/src/greenlet/tests/fail_clearing_run_switches.py'],), kwargs = {'encoding': 'utf-8', 'stderr': -2, 'stdout': -1}
process = <Popen: returncode: 1 args: ['/usr/bin/python3', '/home/user/workspace/gree...>
stdout = 'Traceback (most recent call last):\n  File "/home/user/workspace/greenlet/src/greenlet/tests/fail_clearing_run_switches.py", line 9, in <module>\n    import greenlet\nModuleNotFoundError: No module named \'greenlet\'\n'
stderr = None, retcode = 1

    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
    
        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['/usr/bin/python3', '/home/user/workspace/greenlet/src/greenlet/tests/fail_clearing_run_switches.py']' returned non-zero exit status 1.

/usr/lib/python3.12/subprocess.py:571: CalledProcessError
------------------------------------------------------------------------------ Captured stdout call -------------------------------------------------------------------------------
-----
Failed to run script /home/user/workspace/greenlet/src/greenlet/tests/fail_clearing_run_switches.py
~~~~~
Traceback (most recent call last):
  File "/home/user/workspace/greenlet/src/greenlet/tests/fail_clearing_run_switches.py", line 9, in <module>
    import greenlet
ModuleNotFoundError: No module named 'greenlet'

------
____________________________________________________________ TestBrokenGreenlets.test_reentrant_switch_three_greenlets ____________________________________________________________

self = <greenlet.tests.test_greenlet.TestBrokenGreenlets testMethod=test_reentrant_switch_three_greenlets>

    def test_reentrant_switch_three_greenlets(self):
        # On debug builds of greenlet, this used to crash with an assertion error;
        # on non-debug versions, it ran fine (which it should not do!).
        # Now it always crashes correctly with a TypeError
        ex = self.assertScriptRaises('fail_switch_three_greenlets.py', exitcodes=(1,))
    
>       self.assertIn('TypeError', ex.output)
E       AssertionError: 'TypeError' not found in 'Traceback (most recent call last):\n  File "/home/user/workspace/greenlet/src/greenlet/tests/fail_switch_three_greenlets.py", line 7, in <module>\n    import greenlet\nModuleNotFoundError: No module named \'greenlet\'\n'

src/greenlet/tests/test_greenlet.py:1266: AssertionError
___________________________________________________________ TestBrokenGreenlets.test_reentrant_switch_three_greenlets2 ____________________________________________________________

self = <greenlet.tests.test_greenlet.TestBrokenGreenlets testMethod=test_reentrant_switch_three_greenlets2>

    def test_reentrant_switch_three_greenlets2(self):
        # This actually passed on debug and non-debug builds. It
        # should probably have been triggering some debug assertions
        # but it didn't.
        #
        # I think the fixes for the above test also kicked in here.
>       output = self.run_script('fail_switch_three_greenlets2.py')

src/greenlet/tests/test_greenlet.py:1275: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/greenlet/tests/__init__.py:213: in run_script
    return subprocess.check_output([sys.executable, script],
/usr/lib/python3.12/subprocess.py:466: in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

input = None, capture_output = False, timeout = None, check = True
popenargs = (['/usr/bin/python3', '/home/user/workspace/greenlet/src/greenlet/tests/fail_switch_three_greenlets2.py'],)
kwargs = {'encoding': 'utf-8', 'stderr': -2, 'stdout': -1}, process = <Popen: returncode: 1 args: ['/usr/bin/python3', '/home/user/workspace/gree...>
stdout = 'Traceback (most recent call last):\n  File "/home/user/workspace/greenlet/src/greenlet/tests/fail_switch_three_greenlets2.py", line 5, in <module>\n    import greenlet\nModuleNotFoundError: No module named \'greenlet\'\n'
stderr = None, retcode = 1

    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
    
        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['/usr/bin/python3', '/home/user/workspace/greenlet/src/greenlet/tests/fail_switch_three_greenlets2.py']' returned non-zero exit status 1.

/usr/lib/python3.12/subprocess.py:571: CalledProcessError
------------------------------------------------------------------------------ Captured stdout call -------------------------------------------------------------------------------
-----
Failed to run script /home/user/workspace/greenlet/src/greenlet/tests/fail_switch_three_greenlets2.py
~~~~~
Traceback (most recent call last):
  File "/home/user/workspace/greenlet/src/greenlet/tests/fail_switch_three_greenlets2.py", line 5, in <module>
    import greenlet
ModuleNotFoundError: No module named 'greenlet'

------
_____________________________________________________________ TestBrokenGreenlets.test_reentrant_switch_two_greenlets _____________________________________________________________

self = <greenlet.tests.test_greenlet.TestBrokenGreenlets testMethod=test_reentrant_switch_two_greenlets>

    def test_reentrant_switch_two_greenlets(self):
        # Before we started capturing the arguments in g_switch_finish, this could crash.
>       output = self.run_script('fail_switch_two_greenlets.py')

src/greenlet/tests/test_greenlet.py:1252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/greenlet/tests/__init__.py:213: in run_script
    return subprocess.check_output([sys.executable, script],
/usr/lib/python3.12/subprocess.py:466: in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

input = None, capture_output = False, timeout = None, check = True
popenargs = (['/usr/bin/python3', '/home/user/workspace/greenlet/src/greenlet/tests/fail_switch_two_greenlets.py'],), kwargs = {'encoding': 'utf-8', 'stderr': -2, 'stdout': -1}
process = <Popen: returncode: 1 args: ['/usr/bin/python3', '/home/user/workspace/gree...>
stdout = 'Traceback (most recent call last):\n  File "/home/user/workspace/greenlet/src/greenlet/tests/fail_switch_two_greenlets.py", line 7, in <module>\n    import greenlet\nModuleNotFoundError: No module named \'greenlet\'\n'
stderr = None, retcode = 1

    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
    
        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['/usr/bin/python3', '/home/user/workspace/greenlet/src/greenlet/tests/fail_switch_two_greenlets.py']' returned non-zero exit status 1.

/usr/lib/python3.12/subprocess.py:571: CalledProcessError
------------------------------------------------------------------------------ Captured stdout call -------------------------------------------------------------------------------
-----
Failed to run script /home/user/workspace/greenlet/src/greenlet/tests/fail_switch_two_greenlets.py
~~~~~
Traceback (most recent call last):
  File "/home/user/workspace/greenlet/src/greenlet/tests/fail_switch_two_greenlets.py", line 7, in <module>
    import greenlet
ModuleNotFoundError: No module named 'greenlet'

------
================================================================================ warnings summary =================================================================================
src/greenlet/tests/test_greenlet.py::TestGreenlet::test_dealloc_catches_GreenletExit_throws_other
  /usr/lib/python3/dist-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in: <greenlet.greenlet object at 0x3fb8d01900 (otid=0x3fb9aeecd0) dead>
  
  Traceback (most recent call last):
    File "/home/user/workspace/greenlet/src/greenlet/tests/test_greenlet.py", line 201, in run
      raise SomeError from None
  greenlet.tests.test_greenlet.SomeError
  
    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================= short test summary info =============================================================================
FAILED src/greenlet/tests/test_cpp.py::CPPTests::test_unhandled_exception_in_greenlet_aborts - AssertionError: 1 not found in (-6, -11)
FAILED src/greenlet/tests/test_cpp.py::CPPTests::test_unhandled_nonstd_exception_aborts - AssertionError: 1 not found in (-6, -11)
FAILED src/greenlet/tests/test_cpp.py::CPPTests::test_unhandled_std_exception_aborts - AssertionError: 1 not found in (-6, -11)
FAILED src/greenlet/tests/test_cpp.py::CPPTests::test_unhandled_std_exception_as_greenlet_function_aborts - AssertionError: 1 not found in (-6, -11)
FAILED src/greenlet/tests/test_greenlet.py::TestGreenlet::test_dealloc_catches_GreenletExit_throws_other - AssertionError: 'Exception' not found in ''
FAILED src/greenlet/tests/test_greenlet.py::TestBrokenGreenlets::test_failed_to_slp_switch_into_running - AssertionError: 1 not found in (-6, -11)
FAILED src/greenlet/tests/test_greenlet.py::TestBrokenGreenlets::test_reentrant_switch_GreenletAlreadyStartedInPython - subprocess.CalledProcessError: Command '['/usr/bin/python3', '/home/user/workspace/greenlet/src/greenlet/tests/fail_initialstub_already_started.py']' returned non-zero exit ...
FAILED src/greenlet/tests/test_greenlet.py::TestBrokenGreenlets::test_reentrant_switch_run_callable_has_del - subprocess.CalledProcessError: Command '['/usr/bin/python3', '/home/user/workspace/greenlet/src/greenlet/tests/fail_clearing_run_switches.py']' returned non-zero exit status 1.
FAILED src/greenlet/tests/test_greenlet.py::TestBrokenGreenlets::test_reentrant_switch_three_greenlets - AssertionError: 'TypeError' not found in 'Traceback (most recent call last):\n  File "/home/user/workspace/greenlet/src/greenlet/tests/fail_switch_three_greenlets.py", line ...
FAILED src/greenlet/tests/test_greenlet.py::TestBrokenGreenlets::test_reentrant_switch_three_greenlets2 - subprocess.CalledProcessError: Command '['/usr/bin/python3', '/home/user/workspace/greenlet/src/greenlet/tests/fail_switch_three_greenlets2.py']' returned non-zero exit stat...
FAILED src/greenlet/tests/test_greenlet.py::TestBrokenGreenlets::test_reentrant_switch_two_greenlets - subprocess.CalledProcessError: Command '['/usr/bin/python3', '/home/user/workspace/greenlet/src/greenlet/tests/fail_switch_two_greenlets.py']' returned non-zero exit status 1.
======================================================== 11 failed, 127 passed, 1 skipped, 1 warning in 433.26s (0:07:13) =========================================================

shaldengeki referenced this issue in shaldengeki/monorepo Sep 24, 2024
Bumps [greenlet](https://github.com/python-greenlet/greenlet) from 3.0.3
to 3.1.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/python-greenlet/greenlet/blob/master/CHANGES.rst">greenlet's
changelog</a>.</em></p>
<blockquote>
<h1>3.1.1 (2024-09-20)</h1>
<ul>
<li>Fix crashes on 32-bit PPC Linux. Note that there is no CI for this,
and support is best effort; there may be other issues lurking.
See <code>issue 422
&lt;https://github.com/python-greenlet/greenlet/issues/422&gt;</code>_.</li>
<li>Remove unnecessary logging sometimes during interpreter shutdown.
See <code>issue 426
&lt;https://github.com/python-greenlet/greenlet/issues/426&gt;</code>_.</li>
<li>Fix some crashes on 32-bit PPC MacOS. This is a very old platform,
and is only known to be tested on beta versions of an operating
system that was never released, using the GCC 14 only provided by
MacPorts; it may or may not work on the final MacOS X release that
supported 32-bit PowerPC. It has the known issue of leaking memory
when greenlets are used in multiple threads. Help debugging this
would be appreciated. See <code>PR 419
&lt;https://github.com/python-greenlet/greenlet/pull/419&gt;</code>_.</li>
</ul>
<h1>3.1.0 (2024-09-10)</h1>
<p>.. note::</p>
<pre><code>This will be the last release to support Python 3.7 and 3.8.
</code></pre>
<ul>
<li>Adds support for Python 3.13.</li>
</ul>
<p>.. note::</p>
<p>greenlet will not work in no-gil (free threaded) builds of CPython.
Internally, greenlet heavily depends on the GIL.</p>
<ul>
<li>Greatly reduce the chances for crashes during interpreter shutdown.
See <code>issue 411
&lt;https://github.com/python-greenlet/greenlet/issues/411&gt;</code>_.</li>
</ul>
<h2>Platform Support</h2>
<p>Support for the following platforms was contributed by the community.
Note that they are untested by this project's continuous integration
services.</p>
<ul>
<li>Hitachi's <code>SuperH CPU
&lt;https://github.com/python-greenlet/greenlet/issues/166&gt;</code>_.</li>
<li><code>NetBSD on PowerPC.
&lt;https://github.com/python-greenlet/greenlet/pull/402&gt;</code>_</li>
<li>RiscV 64 with <code>-fno-omit-frame-pointer
&lt;https://github.com/python-greenlet/greenlet/pull/404&gt;</code><em>.
Note that
there are <code>known test failures
&lt;https://github.com/python-greenlet/greenlet/issues/403&gt;</code></em>,
so this</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/python-greenlet/greenlet/commit/dd0a948da112a574864b518e5739bd90d068a1b0"><code>dd0a948</code></a>
Preparing release 3.1.1</li>
<li><a
href="https://github.com/python-greenlet/greenlet/commit/ab8d3bc1245f0e454cd3865009f6332a8c0090a0"><code>ab8d3bc</code></a>
Disable thread-local cleanup on 32-bit MacOS PPC with GCC. This will
result i...</li>
<li><a
href="https://github.com/python-greenlet/greenlet/commit/e9db22a94101e10909829c198b6d693ccf11f48f"><code>e9db22a</code></a>
Merge pull request <a
href="https://redirect.github.com/python-greenlet/greenlet/issues/429">#429</a>
from python-greenlet/issue419redux</li>
<li><a
href="https://github.com/python-greenlet/greenlet/commit/6081a16bb1c560262b34cf112896a6982756d02c"><code>6081a16</code></a>
Merge pull request <a
href="https://redirect.github.com/python-greenlet/greenlet/issues/419">#419</a>
from barracuda156/powerpc</li>
<li><a
href="https://github.com/python-greenlet/greenlet/commit/dbf311a021d80aecb38033a9f44fcf13be9e7a6f"><code>dbf311a</code></a>
Greater safety and fewer assumptions doing cross-thread cleanup.</li>
<li><a
href="https://github.com/python-greenlet/greenlet/commit/9e8a90b1a47e1254df65057af444671e22ca61e0"><code>9e8a90b</code></a>
Set back greenlet_thread_state.hpp file</li>
<li><a
href="https://github.com/python-greenlet/greenlet/commit/1bf374f4d8aaa8039012f70f93249726d23bdf59"><code>1bf374f</code></a>
Duplicate greenlet_thread_state.hpp history.</li>
<li><a
href="https://github.com/python-greenlet/greenlet/commit/64e0b4f6ceaa5cc2debafe551caea1276aa84aa9"><code>64e0b4f</code></a>
Copy greenlet_thread_state.hpp into TThreadStateCreator.hpp</li>
<li><a
href="https://github.com/python-greenlet/greenlet/commit/358a2e8f20816a68e65703b5488dd0337722a9a9"><code>358a2e8</code></a>
Keep greenlet_thread_state.hpp</li>
<li><a
href="https://github.com/python-greenlet/greenlet/commit/5144f7070cd7882f643f6b16a3dbc9138dbbf483"><code>5144f70</code></a>
Sigh. Pip hides compiler output which is, you know, important, and the
only w...</li>
<li>Additional commits viewable in <a
href="https://github.com/python-greenlet/greenlet/compare/3.0.3...3.1.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=greenlet&package-manager=pip&previous-version=3.0.3&new-version=3.1.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants