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

Nose tests failing to run (Failure: TypeError) on Linux with Python 3.5 #18150

Closed
andrewkroh opened this issue May 1, 2020 · 2 comments · Fixed by #18152
Closed

Nose tests failing to run (Failure: TypeError) on Linux with Python 3.5 #18150

andrewkroh opened this issue May 1, 2020 · 2 comments · Fixed by #18152
Labels
flaky-test Unstable or unreliable test cases. needs_team Indicates that the issue/PR needs a Team:* label

Comments

@andrewkroh
Copy link
Member

Flaky Test

Stack Trace

 >> python test: Unit Testing
 E
 ======================================================================
 ERROR: Failure: TypeError (Cannot subscript an existing Union. Use Union[u, t] instead.)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18149/python-env/build/ve/linux/lib/python3.5/site-packages/nose/failure.py", line 39, in runTest
     raise self.exc_val.with_traceback(self.tb)
   File "/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18149/python-env/build/ve/linux/lib/python3.5/site-packages/nose/loader.py", line 418, in loadTestsFromName
     addr.filename, addr.module)
   File "/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18149/python-env/build/ve/linux/lib/python3.5/site-packages/nose/importer.py", line 47, in importFromPath
     return self.importFromDir(dir_path, fqname)
   File "/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18149/python-env/build/ve/linux/lib/python3.5/site-packages/nose/importer.py", line 94, in importFromDir
     mod = load_module(part_fqname, fh, filename, desc)
   File "/usr/lib/python3.5/imp.py", line 234, in load_module
     return load_source(name, filename, file)
   File "/usr/lib/python3.5/imp.py", line 172, in load_source
     module = _load(spec)
   File "<frozen importlib._bootstrap>", line 693, in _load
   File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
   File "<frozen importlib._bootstrap_external>", line 665, in exec_module
   File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
   File "/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18149/src/github.com/elastic/beats/x-pack/filebeat/tests/system/test_xpack_modules.py", line 6, in <module>
     import test_modules
   File "/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18149/src/github.com/elastic/beats/x-pack/filebeat/tests/system/../../../../filebeat/tests/system/test_modules.py", line 12, in <module>
     from deepdiff import DeepDiff
   File "/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18149/python-env/build/ve/linux/lib/python3.5/site-packages/deepdiff/__init__.py", line 10, in <module>
     from .diff import DeepDiff
   File "/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18149/python-env/build/ve/linux/lib/python3.5/site-packages/deepdiff/diff.py", line 17, in <module>
     from ordered_set import OrderedSet
   File "/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18149/python-env/build/ve/linux/lib/python3.5/site-packages/ordered_set.py", line 51, in <module>
     class OrderedSet(MutableSet[T], Sequence[T]):
   File "/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18149/python-env/build/ve/linux/lib/python3.5/site-packages/ordered_set.py", line 186, in OrderedSet
     def update(self, sequence: SetLike[T]) -> int:
   File "/usr/lib/python3.5/typing.py", line 546, in __getitem__
     "Cannot subscript an existing Union. Use Union[u, t] instead.")
 TypeError: Cannot subscript an existing Union. Use Union[u, t] instead.

build.txt

@andrewkroh andrewkroh added the flaky-test Unstable or unreliable test cases. label May 1, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 1, 2020
andrewkroh added a commit to andrewkroh/beats that referenced this issue May 1, 2020
When starting the Python tests under Jenkins (Linux with Python 3.5) it's failing as per elastic#18150.

So as a work-around I'm skipping this test target. Everyone of the python tests in the package
requires the integration environment so we want be losing any test coverage. But we need to
figure out why this suddenly stopped working.
@andrewkroh
Copy link
Member Author

On my mac this target runs without error. There is a deprecation warning though.

$ mage pythonUnitTest
>> python test: Unit Testing
/Users/akroh/go/src/github.com/elastic/beats/build/ve/darwin/lib/python3.7/site-packages/nose/suite.py:541: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
  if isinstance(tests, collections.Callable) or isinstance(tests, unittest.TestSuite):
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
----------------------------------------------------------------------
Ran 116 tests in 0.012s

OK (SKIP=116)
>> python test: Unit Testing Complete

andrewkroh added a commit to andrewkroh/beats that referenced this issue May 1, 2020
A new version of ordered-set was released on April 29, 2020 and builds
under Python 3.5 on Jenkins started failing. So this pins the version of
ordered-set to the previous version that it was using and working under.

Fixes elastic#18150
@andrewkroh
Copy link
Member Author

A new version of ordered-set was released on April 29, 2020. I'm testing pinning it to the previous version 3.1.1. See #18152.

andrewkroh added a commit that referenced this issue May 2, 2020
A new version of ordered-set was released on April 29, 2020 and builds
under Python 3.5 on Jenkins started failing. So this pins the version of
ordered-set to the previous version that it was using and working under.

Fixes #18150
@andresrc andresrc removed the needs_team Indicates that the issue/PR needs a Team:* label label May 2, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 2, 2020
@andresrc andresrc removed the needs_team Indicates that the issue/PR needs a Team:* label label May 2, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 2, 2020
andrewkroh added a commit to andrewkroh/beats that referenced this issue May 2, 2020
A new version of ordered-set was released on April 29, 2020 and builds
under Python 3.5 on Jenkins started failing. So this pins the version of
ordered-set to the previous version that it was using and working under.

Fixes elastic#18150

(cherry picked from commit 522ffd5)
andrewkroh added a commit that referenced this issue May 4, 2020
A new version of ordered-set was released on April 29, 2020 and builds
under Python 3.5 on Jenkins started failing. So this pins the version of
ordered-set to the previous version that it was using and working under.

Fixes #18150

(cherry picked from commit 522ffd5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-test Unstable or unreliable test cases. needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants