From b9c7dabdb1be214a31bba5710a2a88526b30628d Mon Sep 17 00:00:00 2001 From: Daniel J Magee <43071310+dmageeLANL@users.noreply.github.com> Date: Wed, 17 Apr 2024 06:58:47 -0600 Subject: [PATCH] =?UTF-8?q?Fixed=20on=5Fnode=20failed=20build=20non-stoppi?= =?UTF-8?q?ng=20problem.=20Now=20builds=20with=20on=5Fn=E2=80=A6=20(#765)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixed on_node failed build non-stopping problem. Now builds with on_node: true, do not run after the build failed and do not write BUILD_CREATED lines whenever queried. * Add text to exception to satisfy style. * Add particular exception to satisfy style. --- lib/pavilion/builder.py | 4 +++- lib/pavilion/commands/_run.py | 6 +++--- lib/pavilion/status_file.py | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/pavilion/builder.py b/lib/pavilion/builder.py index 99b3fe859..ef8243c44 100644 --- a/lib/pavilion/builder.py +++ b/lib/pavilion/builder.py @@ -96,7 +96,9 @@ def __init__(self, pav_cfg: pavilion.config.PavConfig, working_dir: Path, config self.path = working_dir/'builds'/self.name # type: Path - if not self.path.exists(): + current_status = status.current() + + if not self.path.exists() and "ERROR" not in current_status.state: status.set(state=STATES.BUILD_CREATED, note="Builder created.") self.tmp_log_path = self.path.with_suffix('.log') diff --git a/lib/pavilion/commands/_run.py b/lib/pavilion/commands/_run.py index c2fe44824..244c79b1c 100644 --- a/lib/pavilion/commands/_run.py +++ b/lib/pavilion/commands/_run.py @@ -7,7 +7,7 @@ from pavilion import result from pavilion import schedulers -from pavilion.errors import TestRunError, ResultError +from pavilion.errors import TestRunError, ResultError, TestBuilderError from pavilion.output import fprint from pavilion.status_file import STATES from pavilion.sys_vars import base_classes @@ -77,8 +77,8 @@ def run(self, pav_cfg, args): try: if not test.build_local: if not test.build(): - fprint(sys.stdout, "Test {} failed to build.".format(test.full_id)) - + fprint(sys.stdout, "Test {} build failed.".format(test.full_id)) + raise TestBuilderError("Unknown build error.") except Exception: test.status.set( STATES.BUILD_ERROR, diff --git a/lib/pavilion/status_file.py b/lib/pavilion/status_file.py index 738f3b680..e3cc8415b 100644 --- a/lib/pavilion/status_file.py +++ b/lib/pavilion/status_file.py @@ -304,7 +304,7 @@ def _parse_status_line(self, line) -> TestStatusInfo: except ValueError: try: when = datetime.datetime.strptime( - parts.pop(0), self.info_class.TIME_FORMAT).timestamp() + time_part, self.info_class.TIME_FORMAT).timestamp() except ValueError: # Use the beginning of time on errors when = datetime.datetime(0, 0, 0)