Skip to content

Commit

Permalink
Fixed on_node failed build non-stopping problem. Now builds with on_n… (
Browse files Browse the repository at this point in the history
#765)

* 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.
  • Loading branch information
dmageeLANL authored and hwikle-lanl committed Jun 7, 2024
1 parent 667b970 commit b9c7dab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/pavilion/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
6 changes: 3 additions & 3 deletions lib/pavilion/commands/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/pavilion/status_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b9c7dab

Please sign in to comment.