Bug 1335127 - Fall back to stub IO counters when psutil fails; r=gps

The fallback at [1], when psutil.disk_io_counters() fails, returns a
simple list but callers to get_disk_io_counters() expect an object with
specific properties. Returning a stub object from PsutilStub fixes that.

[1] https://dxr.mozilla.org/mozilla-central/rev/1d025ac534a6333a8170a59a95a8a3673d4028ee/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py#67
This commit is contained in:
Jim Chen 2017-02-01 17:26:51 -05:00
Родитель 8e5b3bd738
Коммит e6583a6227
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -64,7 +64,7 @@ def get_disk_io_counters():
try:
io_counters = psutil.disk_io_counters()
except RuntimeError:
io_counters = []
io_counters = PsutilStub().disk_io_counters()
return io_counters