Skip to content

Commit

Permalink
[3.13] gh-99242 Ignore error when running regression tests under cert…
Browse files Browse the repository at this point in the history
…ain conditions. (GH-121663) (GH-121669)

(cherry picked from commit 0759cec)

Co-authored-by: Bas Bloemsaat <bas@bloemsaat.com>
Co-authored-by: Kevin Diem <kg.diem@gmail.com>
  • Loading branch information
3 people committed Jul 22, 2024
1 parent 148beb6 commit f00ba73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Lib/test/libregrtest/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ def log(self, line: str = '') -> None:

def get_load_avg(self) -> float | None:
if hasattr(os, 'getloadavg'):
return os.getloadavg()[0]
try:
return os.getloadavg()[0]
except OSError:
pass
if self.win_load_tracker is not None:
return self.win_load_tracker.getloadavg()
return None
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:func:`os.getloadavg` may throw :exc:`OSError` when running regression tests
under certain conditions (e.g. chroot). This error is now caught and
ignored, since reporting load average is optional.

0 comments on commit f00ba73

Please sign in to comment.