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

test_gardenpath fails on OpenIndiana #395

Closed
mtelka opened this issue Jan 3, 2023 · 6 comments · Fixed by #397
Closed

test_gardenpath fails on OpenIndiana #395

mtelka opened this issue Jan 3, 2023 · 6 comments · Fixed by #397

Comments

@mtelka
Copy link

mtelka commented Jan 3, 2023

The test_gardenpath test fails on OpenIndiana because the string returned from strerror() is implementation specific.

Simple test case in C:

#include <stdio.h>
#include <string.h>
#include <errno.h>

int main(void)
{
        printf("%s\n", strerror(EPERM));
        return 0;
}

On linux it prints: Operation not permitted, but on OpenIndiana (and thus on all illumos based distros, and likely Solaris too) it prints: Not owner.

Here is the test failure:

________________________ Test__strerror.test_gardenpath ________________________

self = <tests.test_wasyncore.Test__strerror testMethod=test_gardenpath>

    def test_gardenpath(self):
>       self.assertEqual(self._callFUT(1), "Operation not permitted")

tests/test_wasyncore.py:1199:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.9/vendor-packages/teamcity/diff_tools.py:33: in _patched_equals
    old(self, first, second, msg)
E   AssertionError: 'Not owner' != 'Operation not permitted'
E   - Not owner
E   + Operation not permitted
@digitalresistor
Copy link
Member

I wonder if the original test suite ever passed on OpenIndiana as asyncore was vendored from Python when they dropped support for it.

@mtelka
Copy link
Author

mtelka commented Jan 18, 2023

All tests pass with both Python 3.7 and 3.9 when I replace Operation not permitted by Not owner in test_wasyncore.py (see https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/python/waitress/patches/02-test_gardenpath.patch)

@digitalresistor
Copy link
Member

@mtelka sure, I get that changing the test works.

My question is how did the Python 3.5 test suite pass on OpenIndiana? wasyncore is directly vendoring asyncore as it was shipped with Python 3.5 including all tests.

@mtelka
Copy link
Author

mtelka commented Jan 18, 2023

I'm not sure I fully understand your question because both Python-3.5.10/Lib/test/test_asyncore.py and waitress-2.1.2/tests/test_wasyncore.py files differs significantly. For example, there is no class Test__strerror in Python-3.5.10/Lib/test/test_asyncore.py.

@digitalresistor
Copy link
Member

I thought that when it was vendored it was from the 3.5 branch of Python, I wonder where @mcdonc stole it from instead. I can add a patch, unfortunately I don't have a machine to test on and it won't be tested in CI either, so there may be other regressions.

@digitalresistor
Copy link
Member

Looks like @mcdonc made that test up as the original code is not tested in cpython. I'm changing the test a little bit which should help make it pass on all platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants