Skip to content

Commit

Permalink
Fix flake8 errors/warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ppigazzini committed Jun 25, 2024
1 parent 04466a9 commit c103c8d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
1 change: 0 additions & 1 deletion server/fishtest/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
12 changes: 1 addition & 11 deletions server/fishtest/rundb.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import textwrap
import threading
import time
from datetime import datetime, timedelta, timezone
from datetime import datetime, timezone

import fishtest.stats.stat_util
from bson.binary import Binary
Expand All @@ -34,7 +34,6 @@
Scheduler,
crash_or_time,
estimate_game_duration,
format_bounds,
format_results,
get_bad_workers,
get_chi2,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 5 additions & 3 deletions server/fishtest/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import fishtest.stats.stat_util
import requests
from fishtest.schemas import runs_schema, short_worker_name
from fishtest.schemas import RUN_VERSION, runs_schema, short_worker_name
from fishtest.util import (
email_valid,
extract_repo_from_link,
Expand Down Expand Up @@ -1404,10 +1404,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="fishtest.system",
message=message,
)
Expand Down

0 comments on commit c103c8d

Please sign in to comment.