test: keep dispatch fencing inputs config-neutral

This commit is contained in:
root
2026-07-10 04:03:27 +02:00
parent 47885c22f1
commit 424b4967e8
@@ -213,14 +213,14 @@ async function assertEnabledDispatcherRejectsLegacyDefaults(): Promise<void> {
function assertTerminalTransitionsFenceDispatchIntents(): void {
const cancelledRunStore = new MemoryAgentRunStore();
const cancelledRun = cancelledRunStore.createRun(runInput());
const cancelledRunCommand = cancelledRunStore.createCommand(cancelledRun.id, validateCreateCommand({ type: "turn", payload: {}, dispatch: { kind: "kubernetes-job", input: { image } } }));
const cancelledRunCommand = cancelledRunStore.createCommand(cancelledRun.id, validateCreateCommand({ type: "turn", payload: {}, dispatch: { kind: "kubernetes-job", input: {} } }));
cancelledRunStore.cancelRun(cancelledRun.id, "selftest cancel run");
assertCancelledIntent(cancelledRunStore, cancelledRunCommand.id);
assert.equal(cancelledRunStore.claimRunnerDispatchIntents({ owner: "late-dispatcher", leaseMs: 10_000, limit: 1 }).length, 0);
const cancelledCommandStore = new MemoryAgentRunStore();
const cancelledCommandRun = cancelledCommandStore.createRun(runInput());
const cancelledCommand = cancelledCommandStore.createCommand(cancelledCommandRun.id, validateCreateCommand({ type: "turn", payload: {}, dispatch: { kind: "kubernetes-job", input: { image } } }));
const cancelledCommand = cancelledCommandStore.createCommand(cancelledCommandRun.id, validateCreateCommand({ type: "turn", payload: {}, dispatch: { kind: "kubernetes-job", input: {} } }));
const claim = cancelledCommandStore.claimRunnerDispatchIntents({ owner: "inflight-dispatcher", leaseMs: 10_000, limit: 1 })[0];
assert.ok(claim);
cancelledCommandStore.cancelCommand(cancelledCommand.id, "selftest cancel command");
@@ -229,10 +229,10 @@ function assertTerminalTransitionsFenceDispatchIntents(): void {
const finishedStore = new MemoryAgentRunStore();
const finishedRun = finishedStore.createRun(runInput());
const finishedCommand = finishedStore.createCommand(finishedRun.id, validateCreateCommand({ type: "turn", payload: {}, dispatch: { kind: "kubernetes-job", input: { image } } }));
const finishedCommand = finishedStore.createCommand(finishedRun.id, validateCreateCommand({ type: "turn", payload: {}, dispatch: { kind: "kubernetes-job", input: {} } }));
finishedStore.finishCommand(finishedCommand.id, { terminalStatus: "completed", failureKind: null, failureMessage: null, threadId: null, turnId: null });
assertCancelledIntent(finishedStore, finishedCommand.id);
const runTerminalCommand = finishedStore.createCommand(finishedRun.id, validateCreateCommand({ type: "turn", payload: {}, dispatch: { kind: "kubernetes-job", input: { image } } }));
const runTerminalCommand = finishedStore.createCommand(finishedRun.id, validateCreateCommand({ type: "turn", payload: {}, dispatch: { kind: "kubernetes-job", input: {} } }));
finishedStore.finishRun(finishedRun.id, { terminalStatus: "completed", failureKind: null, failureMessage: null, threadId: null, turnId: null });
assertCancelledIntent(finishedStore, runTerminalCommand.id);
}
@@ -240,7 +240,7 @@ function assertTerminalTransitionsFenceDispatchIntents(): void {
function assertSettleFencesNewlyTerminalParent(): void {
const store = new TerminalProjectionStore();
const run = store.createRun(runInput());
const command = store.createCommand(run.id, validateCreateCommand({ type: "turn", payload: {}, dispatch: { kind: "kubernetes-job", input: { image } } }));
const command = store.createCommand(run.id, validateCreateCommand({ type: "turn", payload: {}, dispatch: { kind: "kubernetes-job", input: {} } }));
const claim = store.claimRunnerDispatchIntents({ owner: "race-dispatcher", leaseMs: 10_000, limit: 1 })[0];
assert.ok(claim);
store.projectTerminal = true;