Skip to content

Commit f00ba73

Browse files
miss-islingtonbasbloemsaatkgdiem
authored
[3.13] gh-99242 Ignore error when running regression tests under certain conditions. (GH-121663) (GH-121669)
(cherry picked from commit 0759cec) Co-authored-by: Bas Bloemsaat <[email protected]> Co-authored-by: Kevin Diem <[email protected]>
1 parent 148beb6 commit f00ba73

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Lib/test/libregrtest/logger.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ def log(self, line: str = '') -> None:
4343

4444
def get_load_avg(self) -> float | None:
4545
if hasattr(os, 'getloadavg'):
46-
return os.getloadavg()[0]
46+
try:
47+
return os.getloadavg()[0]
48+
except OSError:
49+
pass
4750
if self.win_load_tracker is not None:
4851
return self.win_load_tracker.getloadavg()
4952
return None
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:func:`os.getloadavg` may throw :exc:`OSError` when running regression tests
2+
under certain conditions (e.g. chroot). This error is now caught and
3+
ignored, since reporting load average is optional.

0 commit comments

Comments
 (0)