8000 gh-99242 Ignore error when running regression tests under certain conditions. by basbloemsaat · Pull Request #121663 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-99242 I 8000 gnore error when running regression tests under certain conditions. #121663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading
0