You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running on a system whose architecture is such that psutil.cpu_freq() returns None, pytest-monitor crashes pytest on startup:
AttributeError: 'NoneType' object has no attribute 'current'
To Reproduce
An example of an architecture with this problem is 5.10.104-linuxkit, the version used by the Docker image python:3.9-slim-buster.
As of the current version 5.9.0, psutil tries to find the CPU service in /sys/devices/system/cpu/cpufreq/policy0 or /sys/devices/system/cpu/cpu0/cpufreq; if it can't find it there, it checks /proc/cpuinfo for lines starting with cpu mhz. But that doesn't always work (in my case the CPU was given only in BogoMIPS). In that case it returns None, triggering this crash.
Expected behavior
Prefer that pytest-monitor fails gracefully in this case, or perhaps defaults CPU utilization to zero and emits a warning.
Desktop (please complete the following information):
OS: 5.10.104-linuxkit
Python version: 3.9.12
Pytest version: 6.2.1
pytest-monitor version: 1.6.3
The text was updated successfully, but these errors were encountered:
* Fix - #56: Force CPU frequency to 0 when unable to fetch it.
On some system, it appears to not be feasible to fetch the frequency.
Under such circumstances, the CPU frequency is set to 0 and a warning
is emited.
Describe the bug
When running on a system whose architecture is such that
psutil.cpu_freq()
returnsNone
,pytest-monitor
crashespytest
on startup:To Reproduce
An example of an architecture with this problem is
5.10.104-linuxkit
, the version used by the Docker imagepython:3.9-slim-buster
.As of the current version 5.9.0,
psutil
tries to find the CPU service in/sys/devices/system/cpu/cpufreq/policy0
or/sys/devices/system/cpu/cpu0/cpufreq
; if it can't find it there, it checks/proc/cpuinfo
for lines starting withcpu mhz
. But that doesn't always work (in my case the CPU was given only in BogoMIPS). In that case it returnsNone
, triggering this crash.Expected behavior
Prefer that
pytest-monitor
fails gracefully in this case, or perhaps defaults CPU utilization to zero and emits a warning.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: