tests: py-spy fails on uwsgi 2.7 glibc on aarch64
- Dominant language
- Python
- Stars
- 826
- Forks
- 79
- PR merge metrics
- No merged PRs in 30d
Description
Exemplary failure output:
```
=================================== FAILURES ===================================
_______________ test_python_matrix[py-spy-2.7-glibc-uwsgi-True] ________________
application_pid = 2265006
assert_collapsed = functools.partial(, 'burner')
profiler_type = 'py-spy', application_image_tag = '2.7-glibc-uwsgi'
profiler_state =
@pytest.mark.parametrize("in_container", [True])
@pytest.mark.parametrize(
"application_image_tag",
[
"2.7-glibc-python",
"2.7-musl-python",
"3.5-glibc-python",
"3.5-musl-python",
"3.6-glibc-python",
"3.6-musl-python",
"3.7-glibc-python",
"3.7-musl-python",
"3.8-glibc-python",
"3.8-musl-python",
"3.9-glibc-python",
"3.9-musl-python",
"3.10-glibc-python",
"3.10-musl-python",
"2.7-glibc-uwsgi",
"2.7-musl-uwsgi",
"3.7-glibc-uwsgi",
"3.7-musl-uwsgi",
],
)
@pytest.mark.parametrize("profiler_type", ["py-spy", "pyperf"])
def test_python_matrix(
application_pid: int,
assert_collapsed: AssertInCollapsed,
profiler_type: str,
application_image_tag: str,
profiler_state: ProfilerState,
) -> None:
python_version, libc, app = application_image_tag.split("-")
# pyperf is not working on aarch right now https://github.com/Granulate/gprofiler/issues/499
if platform.machine() == "aarch64" and profiler_type == "pyperf":
pytest.skip("PyPerf doesn't support aarch64 architecture!")
if python_version == "3.5" and profiler_type == "pyperf":
pytest.skip("PyPerf doesn't support Python 3.5!")
if python_version == "2.7" and profiler_type == "pyperf" and app == "uwsgi":
pytest.xfail("This combination fails, see https://github.com/Granulate/gprofiler/issues/485")
# if python_version == "2.7" and profiler_type == "py-spy" and app == "uwsgi":
# pytest.xfail("This combination fails, see ")
if python_version in ["2.7", "3.7", "3.8", "3.9", "3.10"] and profiler_type == "py-spy" and libc == "musl":
pytest.xfail("This combination fails, see ")
with PythonProfiler(1000, 2, profiler_state, profiler_type, True, None) as profiler:
profile = snapshot_pid_profile(profiler, application_pid)
collapsed = profile.stacks
> assert_collapsed(collapsed)
tests/test_python.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
function_name = 'burner'
collapsed = ProfilingErrorStack({'uwsgi;[Profiling error: exception CalledProcessError]': 1})
def assert_function_in_collapsed(function_name: str, collapsed: StackToSampleCount) -> None:
print(f"collapsed: {collapsed}")
> assert is_function_in_collapsed(function_name, collapsed), f"function {function_name!r} missing in collapsed data!"
E AssertionError: function 'burner' missing in collapsed data!
tests/utils.py:171: AssertionError
----------------------------- Captured stdout call -----------------------------
collapsed: ProfilingErrorStack({'uwsgi;[Profiling error: exception CalledProcessError]': 1})
------------------------------ Captured log call -------------------------------
WARNING gprofiler.profilers.profiler_base:__init__.py:467 PySpyProfiler: Requested frequency (1000) is higher than the limit 50, limiting the frequency to the limit (50)
WARNING gprofiler.metadata.application_identifiers:application_identifiers.py:205 _UwsgiApplicationIdentifier Couldn't find uwsgi wsgi module, both from cmdline and from config file
ERROR gprofiler.profilers.profiler_base:profiler_base.py:145 PySpyProfiler: failed to profile process 2265006 (uwsgi)
Traceback (most recent call last):
File "/home/ubuntu/gprofiler/gprofiler/profilers/profiler_base.py", line 132, in _wait_for_profiles
result = future.result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 451, in result
return self.__get_result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/ubuntu/gprofiler/gprofiler/profilers/python.py", line 218, in _profile_process
run_process(
File "/home/ubuntu/gprofiler/gprofiler/utils/__init__.py", line 284, in run_process
raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr)
gprofiler.exceptions.CalledProcessError: Command ['/home/ubuntu/gprofiler/gprofiler/resources/python/py-spy', 'record', '-r', '50', '-d', '2', '--nonblocking', '--format', 'raw', '-F', '--output', '/tmp/pytest-of-root/pytest-19/test_python_matrix_py_spy_2_7_2/tmp57dr4b4n/pyspy.fmjqiYkOcKfuECjN.2265006.col', '-p', '2265006', '--full-filenames', '--gil'] returned non-zero exit status 1.
stdout: b''
stderr: b'Error: Bad address (os error 14)\n\n'
=============================== warnings summary ===============================
test_python.py: 83 warnings
/usr/local/lib/python3.10/dist-packages/docker/utils/utils.py:52: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
s1 = StrictVersion(v1)
test_python.py: 83 warnings
/usr/local/lib/python3.10/dist-packages/docker/utils/utils.py:53: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
s2 = StrictVersion(v2)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_python.py::test_python_matrix[py-spy-2.7-glibc-uwsgi-True]
```
Contributor guide
Assessment
This issue has not been assessed yet.