Skip to content

Commit

Permalink
Soften log message on expected non-validation of old run object.
Browse files Browse the repository at this point in the history
  • Loading branch information
vdbergh committed Jul 6, 2024
1 parent 12981ff commit c172141
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions server/fishtest/rundb.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,17 @@ def validate_random_run(self):
)
except ValidationError as e:
message = f"The run object {run_id} does not validate: {str(e)}"
print(message, flush=True)
if "version" in run and run["version"] >= RUN_VERSION:
print(message, flush=True)
self.actiondb.log_message(
username="fishtest.system",
message=message,
)
else:
print(
f"{message} (this is likely not an error as the run object has an older version)",
flush=True,
)

def set_inactive_run(self, run):
run_id = str(run["_id"])
Expand Down Expand Up @@ -1543,12 +1548,18 @@ def stop_run(self, run_id):
validate(runs_schema, run, "run")
except ValidationError as e:
message = f"The run object {run_id} does not validate: {str(e)}"
print(message, flush=True)
if "version" in run and run["version"] >= RUN_VERSION:
print(message, flush=True)
self.actiondb.log_message(
username="fishtest.system",
message=message,
)
else:
print(
f"{message} (this is likely not an error as the run object has an older version)",
flush=True,
)

self.buffer(run, True)

# Auto-purge runs here. This may revive the run.
Expand Down

0 comments on commit c172141

Please sign in to comment.