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: unable to run allowed_errors.py #7718

Closed
koivunej opened this issue May 13, 2024 · 0 comments · Fixed by #7719
Closed

test: unable to run allowed_errors.py #7718

koivunej opened this issue May 13, 2024 · 0 comments · Fixed by #7719
Labels
python Pull requests that update Python code

Comments

@koivunej
Copy link
Contributor

koivunej commented May 13, 2024

$ python3 test_runner/fixtures/pageserver/allowed_errors.py < 3e5db11dc4a18e06.log
Traceback (most recent call last):
  File "/home/admin/src/neon/neon/test_runner/fixtures/pageserver/allowed_errors.py", line 3, in <module>
    import argparse
  File "/usr/lib/python3.9/argparse.py", line 89, in <module>
    import re as _re
  File "/usr/lib/python3.9/re.py", line 124, in <module>
    import enum
  File "/usr/lib/python3.9/enum.py", line 2, in <module>
    from types import MappingProxyType, DynamicClassAttribute
  File "/home/admin/src/neon/neon/test_runner/fixtures/pageserver/types.py", line 2, in <module>
    from dataclasses import dataclass
  File "/usr/lib/python3.9/dataclasses.py", line 3, in <module>
    import copy
  File "/usr/lib/python3.9/copy.py", line 52, in <module>
    import weakref
  File "/usr/lib/python3.9/weakref.py", line 22, in <module>
    from _weakrefset import WeakSet, _IterationGuard
  File "/usr/lib/python3.9/_weakrefset.py", line 6, in <module>
    from types import GenericAlias
ImportError: cannot import name 'GenericAlias' from partially initialized module 'types' (most likely due to a circular import) (/home/admin/src/neon/neon/test_runner/fixtures/pageserver/types.py)

Similarly with poetry run python ....

There are some similar-ish issues around the web, all which suggest renaming types.py.

@koivunej koivunej added the python Pull requests that update Python code label May 13, 2024
@koivunej koivunej linked a pull request May 13, 2024 that will close this issue
koivunej added a commit that referenced this issue May 13, 2024
See #7718. Fix it by renaming all `types.py` to `common_types.py`.

Additionally, add an advert for using `allowed_errors.py` to test any
added regex.
a-masterov pushed a commit that referenced this issue May 20, 2024
See #7718. Fix it by renaming all `types.py` to `common_types.py`.

Additionally, add an advert for using `allowed_errors.py` to test any
added regex.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant