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)