Skip to content

Commit

Permalink
(fixes)
Browse files Browse the repository at this point in the history
  • Loading branch information
dubslow committed Feb 16, 2023
1 parent 7519b2f commit dab0923
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions server/fishtest/rundb.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,10 +997,12 @@ def finished_run_message(self, run):
def handle_crash_or_time(self, run, task_id):
purged = False
task = run["tasks"][task_id]
worker = task["worker_info"]["unique_key"]
history = self.worker_runs[worker].get("crash_time_history", None) # Caution, we don't always have the proper lock for this!
worker = self.worker_runs.get(task["worker_info"]["unique_key"], None)
if worker is None:
worker = self.worker_runs[task["worker_info"]["unique_key"]] = {}
history = worker.get("crash_time_history", None) # Caution, we don't always have the proper lock for this!
if history is None:
history = self.worker_runs[worker]["crash_time_history"] = BinaryHistory(8)
history = worker["crash_time_history"] = BinaryHistory(8)
if crash_or_time(task):
stats = task.get("stats", {})
total = (
Expand Down Expand Up @@ -1146,14 +1148,15 @@ def count_games(d):
# Check if the run is finished.

run_finished = (
count_games(updated_results) >= run["args"]["num_games"]:
count_games(updated_results) >= run["args"]["num_games"]
or "sprt" in run["args"] and sprt["state"] != ""
)

# Return.

if run_finished:
if not task_finished:
task["active"] = False
self.handle_crash_or_time(run, task_id)
self.buffer(run, True)
self.stop_run(run_id)
Expand Down
4 changes: 2 additions & 2 deletions server/fishtest/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def task_purge_and_copy(task):
"crashes": 0,
"time_losses": 0,
"pentanomial": 5 * [0],
})
}
return purged_task


Expand Down Expand Up @@ -561,4 +561,4 @@ def update(self, bit):
self._l[self._i] = bool(bit)
self._i = (self._i + 1) % self._n
def sum(self):
return sum(self._;)
return sum(self._l)

0 comments on commit dab0923

Please sign in to comment.