8000 bpo-37707: Exclude expensive unit tests from PGO task by nascheme · Pull Request #15009 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-37707: Exclude expensive unit tests from PGO task #15009

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
merged 3 commits into from
Jul 30, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Don't skip the tests if --pgo-extended enabled.
  • Loading branch information
nascheme committed Jul 29, 2019
commit c0b746915181a44290f10a4bb2a3bbb0a162fac0
1 change: 1 addition & 0 deletions Lib/test/libregrtest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ def _main(self, tests, kwargs):
input("Press any key to continue...")

support.PGO = self.ns.pgo
support.PGO_EXTENDED = self.ns.pgo_extended

setup_tests(self.ns)

Expand Down
10 changes: 7 additions & 3 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,10 @@ def dec(*args, **kwargs):
# useful for PGO
PGO = False

# Set by libregrtest/main.py if we are running the extended (time consuming)
# PGO task. If this is True, PGO is also True.
PGO_EXTENDED = False

@contextlib.contextmanager
def temp_dir(path=None, quiet=False):
"""Return a context manager that creates a temporary directory.
Expand Down Expand Up @@ -2639,9 +2643,9 @@ def skip_unless_xattr(test):
return test if ok else unittest.skip(msg)(test)

def skip_if_pgo_task(test):
"""Skip decorator for tests that should not run in PGO task"""
ok = not PGO
msg = "Not run for PGO task"
"""Skip decorator for tests not run in (non-extended) PGO task"""
ok = not PGO or PGO_EXTENDED
msg = "Not run for (non-extended) PGO task"
return test if ok else unittest.skip(msg)(test)

_bind_nix_socket_error = None
Expand Down
292E
0