diff --git a/src/experimental/job/job.ts b/src/experimental/job/job.ts index 395705e24..dad128af5 100644 --- a/src/experimental/job/job.ts +++ b/src/experimental/job/job.ts @@ -145,7 +145,8 @@ export class Job { } signal.addEventListener("abort", () => this.events.emit("canceled"), { once: true }); - return workOnGolem(exeUnit); + // remember to `await` here so that the `finally` block is executed AFTER the work is done + return await workOnGolem(exeUnit); } finally { await rental.stopAndFinalize(); }