diff --git a/server/fishtest/rundb.py b/server/fishtest/rundb.py index 838bf7fdb..559e30a4a 100644 --- a/server/fishtest/rundb.py +++ b/server/fishtest/rundb.py @@ -501,6 +501,7 @@ def new_run( if tc_base: tc_base = float(tc_base.group(1)) new_run = { + "_id": ObjectId(), "version": RUN_VERSION, "args": run_args, "start_time": start_time, @@ -566,9 +567,9 @@ def new_run( print(message, flush=True) raise Exception(message) - # We cannot use self.buffer since new_run does not have an id yet. - run_id = str(self.runs.insert_one(new_run).inserted_id) + self.buffer(new_run, True) + run_id = new_run["_id"] with self.unfinished_runs_lock: self.unfinished_runs.add(run_id) diff --git a/server/fishtest/schemas.py b/server/fishtest/schemas.py index 45ed5db4c..0edd477c7 100644 --- a/server/fishtest/schemas.py +++ b/server/fishtest/schemas.py @@ -640,11 +640,11 @@ def flags_must_match(run): # about non-validation of runs created with the prior # schema. -RUN_VERSION = 4 +RUN_VERSION = 5 runs_schema = intersect( { - "_id?": ObjectId, + "_id": ObjectId, "version": uint, "start_time": datetime_utc, "last_updated": datetime_utc,