test(FN-5137): reset executor mocks in soft-delete guard tests

Fusion-Task-Id: FN-5137
Fusion-Task-Lineage: bb2e2e56-d64c-46ca-a6c8-abda13029fc2
This commit is contained in:
Fusion (runfusion.ai)
2026-05-19 07:39:41 -07:00
committed by gsxdsm
parent cb6787066a
commit 9fdb98061a

View File

@@ -1,10 +1,11 @@
import "./executor-test-helpers.js"; import "./executor-test-helpers.js";
import { describe, expect, it, vi } from "vitest"; import { beforeEach, describe, expect, it, vi } from "vitest";
import type { Task } from "@fusion/core"; import type { Task } from "@fusion/core";
import { TaskExecutor } from "../executor.js"; import { TaskExecutor } from "../executor.js";
import { executingTaskLock } from "../active-session-registry.js"; import { executingTaskLock } from "../active-session-registry.js";
import { executorLog } from "../logger.js"; import { executorLog } from "../logger.js";
import * as childProcess from "node:child_process"; import * as childProcess from "node:child_process";
import { resetExecutorMocks } from "./executor-test-helpers.js";
function makeTask(overrides: Partial<Task> & Pick<Task, "id">): Task { function makeTask(overrides: Partial<Task> & Pick<Task, "id">): Task {
return { return {
@@ -42,6 +43,10 @@ function createStore(overrides?: { tasks?: Task[] }) {
} }
describe("TaskExecutor soft-delete guards", () => { describe("TaskExecutor soft-delete guards", () => {
beforeEach(() => {
resetExecutorMocks();
});
it("refuses to execute soft-deleted tasks and releases execution lock", async () => { it("refuses to execute soft-deleted tasks and releases execution lock", async () => {
const store = createStore(); const store = createStore();
const executor = new TaskExecutor(store, "/tmp/test"); const executor = new TaskExecutor(store, "/tmp/test");