diff --git a/server/montytest/api.py b/server/montytest/api.py index b9c111da..ab5b85ec 100644 --- a/server/montytest/api.py +++ b/server/montytest/api.py @@ -296,7 +296,6 @@ def stop_run(self): run["failed"] = True self.request.rundb.stop_run(self.run_id()) else: - task = self.task() self.request.rundb.set_inactive_task(self.task_id(), run) self.request.rundb.buffer(run, True) diff --git a/server/montytest/rundb.py b/server/montytest/rundb.py index a34a84a0..96a71f7a 100644 --- a/server/montytest/rundb.py +++ b/server/montytest/rundb.py @@ -7,7 +7,7 @@ import textwrap import threading import time -from datetime import datetime, timedelta, timezone +from datetime import datetime, timezone import montytest.stats.stat_util from bson.binary import Binary @@ -34,7 +34,6 @@ Scheduler, crash_or_time, estimate_game_duration, - format_bounds, format_results, get_bad_workers, get_chi2, @@ -681,7 +680,6 @@ def flush_buffers(self): old = float("inf") with self.run_cache_lock: for cache_entry in self.run_cache.values(): - run = cache_entry["run"] if cache_entry["is_changed"] and cache_entry["last_sync_time"] < old: old = cache_entry["last_sync_time"] oldest_entry = cache_entry @@ -1540,14 +1538,6 @@ def purge_run(self, run, p=0.001, res=7.0, iters=1): run["bad_tasks"] = [] tasks = copy.copy(run["tasks"]) - zero_stats = { - "wins": 0, - "losses": 0, - "draws": 0, - "crashes": 0, - "time_losses": 0, - "pentanomial": 5 * [0], - } for task_id, task in enumerate(tasks): if "bad" in task: diff --git a/server/montytest/views.py b/server/montytest/views.py index c3bb7055..a168f6ba 100644 --- a/server/montytest/views.py +++ b/server/montytest/views.py @@ -11,7 +11,7 @@ import montytest.stats.stat_util import requests -from montytest.schemas import runs_schema, short_worker_name +from montytest.schemas import RUN_VERSION, runs_schema, short_worker_name from montytest.util import ( email_valid, extract_repo_from_link, @@ -1412,10 +1412,12 @@ def tests_delete(request): try: validate(runs_schema, run, "run") except ValidationError as e: - message = f"The run object {run_id} does not validate: {str(e)}" + message = ( + f"The run object {request.POST["run-id"]} does not validate: {str(e)}" + ) print(message, flush=True) if "version" in run and run["version"] >= RUN_VERSION: - self.actiondb.log_message( + request.actiondb.log_message( username="montytest.system", message=message, )