Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

pytest_otel: failed with python 3.10 for MacOS #1849

Closed
v1v opened this issue Aug 22, 2022 · 2 comments
Closed

pytest_otel: failed with python 3.10 for MacOS #1849

v1v opened this issue Aug 22, 2022 · 2 comments

Comments

@v1v
Copy link
Member

v1v commented Aug 22, 2022

Stacktrace:

tests/system/test_base.py FFFFFFFF                                       [ 61%]
tests/system/test_file_integrity.py FF                                   [ 76%]
Traceback (most recent call last):
  File "/Users/runner/work/beats/beats/build/ve/darwin/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/_pytest/config/__init__.py", line 185, in console_main
    code = main()
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/_pytest/config/__init__.py", line 162, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/pluggy/callers.py", line [80](https://github.com/elastic/beats/runs/7927373390?check_suite_focus=true#step:7:81), in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/_pytest/main.py", line 304, in wrap_session
    config.hook.pytest_sessionfinish(
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/_pytest/terminal.py", line 803, in pytest_sessionfinish
    outcome.get_result()
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/pytest_otel/__init__.py", line 266, in pytest_sessionfinish
    end_span(session_name, exitCodeToOutcome(exitstatus))
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/pytest_otel/__init__.py", line 163, in end_span
    spans[span_name].end()
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/opentelemetry/sdk/trace/__init__.py", line [86](https://github.com/elastic/beats/runs/7927373390?check_suite_focus=true#step:7:87)5, in end
    self._span_processor.on_end(self._readable_span())
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/opentelemetry/sdk/trace/__init__.py", line 161, in on_end
    sp.on_end(span)
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/opentelemetry/sdk/trace/export/__init__.py", line 96, in on_end
    token = attach(set_value(_SUPPRESS_INSTRUMENTATION_KEY, True))
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/opentelemetry/context/__init__.py", line 116, in set_value
    context = get_current()
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/opentelemetry/context/__init__.py", line 67, in wrapper
    return func(*args, **kwargs)  # type: ignore[misc]
  File "/Users/runner/work/beats/beats/build/ve/darwin/lib/python3.10/site-packages/opentelemetry/context/__init__.py", line 131, in get_current
    return _RUNTIME_CONTEXT.get_current()  # type:ignore
tests/system/test_show_command.py sss                                    [100%]>> python test: Unit Testing Complete
AttributeError: 'NoneType' object has no attribute 'get_current'
Error: running "/Users/runner/work/beats/beats/build/ve/darwin/bin/pytest --timeout=[90](https://github.com/elastic/beats/runs/7927373390?check_suite_focus=true#step:7:91) --durations=20 --junit-xml=build/TEST-python-unit.xml tests/system/test_base.py tests/system/test_file_integrity.py tests/system/test_show_command.py" failed with exit code 1
Error: Process completed with exit code 1.

https://github.com/elastic/beats/runs/7927373390?check_suite_focus=true

@v1v
Copy link
Member Author

v1v commented Aug 22, 2022

#1687

@v1v
Copy link
Member Author

v1v commented Aug 22, 2022

duplicates the above issue

@v1v v1v closed this as completed Aug 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant