stop using pytest-monitor for now (#16736)

This commit is contained in:
Kyle Altendorf 2023-10-30 11:51:32 -04:00 committed by GitHub
parent a1edda5c3d
commit 609452303b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 5 deletions

View File

@ -54,7 +54,6 @@ dev_dependencies = [
"pytest-asyncio==0.21.1",
"pytest-cov==4.1.0",
"pytest-mock==3.11.1",
"pytest-monitor==1.6.6; sys_platform == 'linux'",
"pytest-xdist==3.3.1",
"pyupgrade==3.15.0",
"twine==4.0.2",

View File

@ -108,6 +108,7 @@ test_paths = [path for path in test_paths for _ in range(args.duplicates)]
configuration = []
specified_defaults: Dict[Path, Dict[str, Any]] = {}
pytest_monitor_enabling_paths: List[Path] = []
for path in test_paths:
if path.is_dir():
@ -133,9 +134,18 @@ for path in test_paths:
}
pytest_parallel_args = {os: f" -n {count}" for os, count in process_count.items()}
enable_pytest_monitor = conf["check_resource_usage"]
if enable_pytest_monitor:
# NOTE: do not use until the hangs are fixed
# https://github.com/CFMTech/pytest-monitor/issues/53
# https://github.com/pythonprofilers/memory_profiler/issues/342
pytest_monitor_enabling_paths.append(path)
for_matrix = {
"check_resource_usage": conf["check_resource_usage"],
"enable_pytest_monitor": "-p monitor" if conf["check_resource_usage"] else "",
"enable_pytest_monitor": "-p monitor" if enable_pytest_monitor else "",
"job_timeout": round(conf["job_timeout"] * args.timeout_multiplier),
"pytest_parallel_args": pytest_parallel_args,
"checkout_blocks_and_plots": conf["checkout_blocks_and_plots"],
@ -147,12 +157,24 @@ for path in test_paths:
for_matrix = dict(sorted(for_matrix.items()))
configuration.append(for_matrix)
messages: List[str] = []
if len(specified_defaults) > 0:
message = f"Found {len(specified_defaults)} directories with specified defaults"
messages.append(message)
logging.error(f"{message}:")
for path, overlap in sorted(specified_defaults.items()):
logging.info(f" {path} : {overlap}")
raise Exception(message)
logging.error(f" {path} : {overlap}")
if len(pytest_monitor_enabling_paths) > 0:
message = f"Found {len(pytest_monitor_enabling_paths)} directories with pytest-monitor enabled"
messages.append(message)
logging.error(f"{message}:")
for path in sorted(pytest_monitor_enabling_paths):
logging.error(f" {path}")
if len(messages) > 0:
raise Exception("\n".join(messages))
configuration_json = json.dumps(configuration)

View File

@ -1,5 +1,4 @@
from __future__ import annotations
job_timeout = 40
check_resource_usage = True
checkout_blocks_and_plots = True

View File

@ -6,5 +6,8 @@ from typing import Literal, Union
parallel: Union[bool, int, Literal["auto"]] = True
checkout_blocks_and_plots = False
install_timelord = False
# NOTE: do not use until the hangs are fixed
# https://github.com/CFMTech/pytest-monitor/issues/53
# https://github.com/pythonprofilers/memory_profiler/issues/342
check_resource_usage = False
job_timeout = 30