mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
SERVER-58463: burn_in_tags should limit number of tasks created
This commit is contained in:
parent
0a6c656f9a
commit
dc546cfb58
@ -13,6 +13,7 @@ from shrub.v2 import ShrubProject, BuildVariant, ExistingTask
|
||||
from evergreen.api import RetryingEvergreenApi, EvergreenApi
|
||||
|
||||
# Get relative imports to work when the package is not installed on the PYTHONPATH.
|
||||
from buildscripts.patch_builds.task_generation import validate_task_generation_limit
|
||||
|
||||
if __name__ == "__main__" and __package__ is None:
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
@ -178,6 +179,8 @@ def burn_in(task_expansions: Dict[str, Any], evg_conf: EvergreenProjectConfig,
|
||||
_generate_evg_tasks(evergreen_api, shrub_project, task_expansions, build_variant_map, repos,
|
||||
evg_conf)
|
||||
|
||||
if not validate_task_generation_limit(shrub_project):
|
||||
sys.exit(1)
|
||||
write_file_to_dir(CONFIG_DIRECTORY, CONFIG_FILE, shrub_project.json())
|
||||
|
||||
|
||||
|
@ -10,6 +10,19 @@ from structlog import get_logger
|
||||
LOGGER = get_logger(__name__)
|
||||
MAX_SHRUB_TASKS_FOR_SINGLE_TASK = 1000
|
||||
|
||||
MAX_GEN_TASKS_ERR = """
|
||||
********************************************************************************
|
||||
It appears we are trying to generate more tasks than are supported by burn_in.
|
||||
This likely means that a large number of tests have been changed in this patch
|
||||
build.
|
||||
|
||||
burn_in supports of a max of {max_tasks} and your patch requires {patch_tasks}.
|
||||
|
||||
If you would like to validate your changes with burn_in, you will need to break
|
||||
your patch up into patches that each touch a fewer number of tests.
|
||||
********************************************************************************
|
||||
"""
|
||||
|
||||
|
||||
def resmoke_commands(run_tests_fn_name: str, run_tests_vars: Dict[str, Any],
|
||||
timeout_info: TimeoutInfo,
|
||||
@ -91,6 +104,9 @@ def validate_task_generation_limit(shrub_project: ShrubProject) -> bool:
|
||||
"""
|
||||
tasks_to_create = len(shrub_project.all_tasks())
|
||||
if tasks_to_create > MAX_SHRUB_TASKS_FOR_SINGLE_TASK:
|
||||
print(
|
||||
MAX_GEN_TASKS_ERR.format(max_tasks=MAX_SHRUB_TASKS_FOR_SINGLE_TASK,
|
||||
patch_tasks=tasks_to_create))
|
||||
LOGGER.warning("Attempting to create more tasks than max, aborting", tasks=tasks_to_create,
|
||||
max=MAX_SHRUB_TASKS_FOR_SINGLE_TASK)
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user