Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

agentScope.test.ts

561 lines22.2 KB

1// @effect-diagnostics nodeBuiltinImport:off -- fake systemd binaries live in a temp dir.
2import * as NodeFS from "node:fs";
3import * as NodeOS from "node:os";
4import * as NodePath from "node:path";
5​
6import * as NodeServices from "@effect/platform-node/NodeServices";
7import { assert, describe, expect, it } from "@effect/vitest";
8import { AgentScope } from "@t3tools/shared/AgentScope";
9import * as HostProcess from "@t3tools/shared/HostProcess";
10import { symlinksSupported } from "@t3tools/shared/testing/symlinks";
11import * as Effect from "effect/Effect";
12import * as FileSystem from "effect/FileSystem";
13import * as Layer from "effect/Layer";
14import * as Logger from "effect/Logger";
15import { ChildProcess, ChildProcessSpawner } from "effect/process";
16import { vi } from "vite-plus/test";
17​
18import * as ServerConfig from "../config.ts";
19import { makeCodexAppServerSpawnCommand } from "../orchestration-v2/Adapters/CodexAdapterV2.ts";
20import * as ProcessRunner from "../processRunner.ts";
21import * as ProviderProcesses from "./providerProcesses.ts";
22import { classifyScope, make, ownedAgentSlice, type ScopeState } from "./agentScope.ts";
23​
24const GiB = 1024 ** 3;
25const memory = vi.hoisted(() => ({ total: 16 * 1024 ** 3, swapKb: 2 * 1024 ** 2 }));
26vi.mock("node:os", async (importOriginal) => ({
27 ...(await importOriginal<typeof import("node:os")>()),
28 totalmem: () => memory.total,
29}));
30​
31const running: ScopeState = {
32 loadState: "loaded",
33 activeState: "active",
34 result: "success",
35 oomKills: 0,
36 populated: true,
37};
38​
39describe("classifyScope", () => {
40 it("reports an OOM kill only once systemd records it", () => {
41 expect(classifyScope({ ...running, activeState: "failed", result: "oom-kill" })).toBe(
42 "oom-killed",
43 );
44 expect(classifyScope({ ...running, oomKills: 1 })).toBe("stopping");
45 expect(classifyScope({ ...running, populated: false })).toBe("stopping");
46 expect(classifyScope({ ...running, activeState: "deactivating" })).toBe("stopping");
47 });
48});
49​
50interface FakeUnit {
51 activeState: string;
52 result: string;
53 controlGroup?: string;
55​
56const withFakeSystemd = <A, E>(
57 body: (input: {
58 readonly scope: Effect.Success<typeof make>;
59 readonly units: Map<string, FakeUnit>;
60 readonly calls: ReadonlyArray<ReadonlyArray<string>>;
61 readonly failingVerbs: Set<string>;
62 readonly stateDir: string;
63 readonly cgroupRoot: string;
64 }) => Effect.Effect<A, E>,
65 // A user manager older than systemd 253 rejects OOMPolicy on scopes.
66 {
67 oomPolicy = true,
68 stopFails = false,
69 leftovers = false,
70 liveOwner = false,
71 noBinSh = false,
72 noScopes = false,
73 }: {
74 readonly oomPolicy?: boolean;
75 readonly stopFails?: boolean;
76 readonly leftovers?: boolean;
77 readonly liveOwner?: boolean;
78 readonly noBinSh?: boolean;
79 readonly noScopes?: boolean;
80 } = {},
81) =>
82 Effect.gen(function* () {
83 const bin = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3-agent-scope-"));
84 for (const name of ["systemd-run", "systemctl", "agent", "sh"]) {
85 NodeFS.writeFileSync(NodePath.join(bin, name), "", { mode: 0o755 });
86 }
87 const cgroupRoot = NodePath.join(bin, "cgroup");
88 const units = new Map<string, FakeUnit>();
89 const calls: Array<ReadonlyArray<string>> = [];
90 const failingVerbs = new Set<string>();
91 const output = (stdout: string, code = 0): ProcessRunner.ProcessRunOutput => ({
92 stdout,
93 stderr: "",
94 code: ChildProcessSpawner.ExitCode(code),
95 timedOut: false,
96 stdoutTruncated: false,
97 stderrTruncated: false,
98 stdoutInvalidUtf8: false,
99 stderrInvalidUtf8: false,
100 });
101 const runner = ProcessRunner.ProcessRunner.of({
102 run: ({ args }) =>
103 Effect.sync(() => {
104 calls.push(args);
105 if (!oomPolicy && args.some((arg) => arg.startsWith("--property=OOMPolicy="))) {
106 return output("", 1);
107 }
108 const [, verb, unit = ""] = args;
109 if (failingVerbs.has(verb!)) return output("", 1);
110 if (stopFails && verb === "stop") {
111 return {
112 ...output(""),
113 stderr: `Failed to stop ${args.at(-1)}: Unit not loaded.`,
114 code: ChildProcessSpawner.ExitCode(5),
115 };
116 }
117 if (verb === "reset-failed") units.delete(unit);
118 if (verb !== "show") return output("");
119 const state = units.get(unit);
120 return output(
121 state === undefined
122 ? "LoadState=not-found\nActiveState=inactive\nResult=success\n"
123 : `LoadState=loaded\nActiveState=${state.activeState}\nResult=${state.result}\n` +
124 `ControlGroup=${state.controlGroup ?? ""}\n`,
125 );
126 }),
127 });
128 const fileSystem = yield* FileSystem.FileSystem;
129 const { stateDir } = yield* ServerConfig.ServerConfig;
130 if (leftovers) {
131 units.set(ownedAgentSlice(stateDir), { activeState: "active", result: "success" });
132 }
133 const scope = yield* make.pipe(
134 Effect.provideService(ProviderProcesses.ProviderProcesses, { hasOtherLiveOwner: liveOwner }),
135 Effect.provideService(ProcessRunner.ProcessRunner, runner),
136 Effect.provideService(HostProcess.Platform, "linux"),
137 Effect.provideService(
138 HostProcess.Environment,
139 noScopes ? { PATH: bin } : { PATH: bin, XDG_RUNTIME_DIR: "/run/user/1" },
140 ),
141 Effect.provideService(FileSystem.FileSystem, {
142 ...fileSystem,
143 exists: (path) =>
144 noBinSh && path === "/bin/sh" ? Effect.succeed(false) : fileSystem.exists(path),
145 readFileString: (path, encoding) =>
146 path === "/proc/meminfo"
147 ? Effect.sync(() => `MemTotal: 16384 kB\nSwapTotal: ${memory.swapKb} kB\n`)
148 : fileSystem.readFileString(path.replace("/sys/fs/cgroup", cgroupRoot), encoding),
149 writeFileString: (path, data, options) =>
150 fileSystem.writeFileString(path.replace("/sys/fs/cgroup", cgroupRoot), data, options),
151 }),
152 );
153 return yield* body({ scope, units, calls, failingVerbs, stateDir, cgroupRoot }).pipe(
154 Effect.ensuring(Effect.sync(() => NodeFS.rmSync(bin, { recursive: true, force: true }))),
155 );
156 }).pipe(
157 Effect.scoped,
158 Effect.provide(
159 ServerConfig.layerTest(process.cwd(), { prefix: "t3-agent-scope-" }).pipe(
160 Layer.provideMerge(NodeServices.layer),
161 ),
162 ),
163 );
164​
165const unitOf = (launch: Pick<ChildProcess.StandardCommand, "args">) =>
166 launch.args
167 .map(String)
168 .find((arg) => arg.startsWith("--unit="))
169 ?.slice("--unit=".length) ?? "";
170​
171const sliceOf = (launch: { readonly args: ReadonlyArray<string> }) =>
172 launch.args.find((arg) => arg.startsWith("--slice="))?.slice("--slice=".length) ?? "";
173​
174/** An active scope as systemd and the kernel report it, with the agent itself gone. */
175const exitedAgent = (
176 units: Map<string, FakeUnit>,
177 cgroupRoot: string,
178 unit: string,
179 { populated, oomKills }: { readonly populated: boolean; readonly oomKills: number | undefined },
180) => {
181 const controlGroup = `/${unit}`;
182 NodeFS.mkdirSync(NodePath.join(cgroupRoot, controlGroup), { recursive: true });
183 NodeFS.writeFileSync(
184 NodePath.join(cgroupRoot, controlGroup, "cgroup.events"),
185 `populated ${populated ? 1 : 0}\nfrozen 0\n`,
186 );
187 // An undefined count leaves memory.events unreadable.
188 if (oomKills !== undefined) {
189 NodeFS.writeFileSync(
190 NodePath.join(cgroupRoot, controlGroup, "memory.events"),
191 `low 0\nhigh 0\nmax 0\noom ${oomKills}\noom_kill ${oomKills}\noom_group_kill 0\n`,
192 );
193 }
194 units.set(unit, { activeState: "active", result: "success", controlGroup });
195};
196​
197const stopsOf = (calls: ReadonlyArray<ReadonlyArray<string>>) =>
198 calls.filter(([, verb]) => verb === "stop");
199const launchCodex = (
200 scope: Effect.Success<typeof make>,
201 threadId: string,
202 env?: NodeJS.ProcessEnv,
203) =>
204 makeCodexAppServerSpawnCommand({ command: "agent", args: ["app-server"], threadId, env }).pipe(
205 Effect.provideService(AgentScope, scope),
206 Effect.provideService(HostProcess.Platform, "linux"),
207 Effect.map((command) => {
208 assert(ChildProcess.isStandardCommand(command));
209 return command;
210 }),
211 );
212​
213describe("AgentScope service", () => {
214 it.effect("launches through sh from PATH when the host has no /bin/sh", () =>
215 Effect.gen(function* () {
216 const withScopes = yield* withFakeSystemd(({ scope }) =>
217 scope.wrap({ command: "agent", args: [], name: "t" }),
218 );
219 expect(withScopes.command).toBe("/bin/sh");
220 const scoped = yield* withFakeSystemd(
221 ({ scope }) => scope.wrap({ command: "agent", args: [], name: "t" }),
222 { noBinSh: true },
223 );
224 const unscoped = yield* withFakeSystemd(
225 ({ scope }) => scope.wrap({ command: "agent", args: [], name: "t" }),
226 { noBinSh: true, noScopes: true },
227 );
228 for (const launch of [scoped, unscoped]) {
229 expect(NodePath.basename(launch.command)).toBe("sh");
230 expect(launch.command).not.toBe("/bin/sh");
231 expect(NodePath.basename(String(launch.args.at(-1)))).toBe("agent");
232 }
233 expect(unscoped.args).not.toContain("--scope");
234 }),
235 );
236​
237 it.effect("labels a thread from its newest scope until its next session clears it", () =>
238 withFakeSystemd(({ scope, units }) =>
239 Effect.gen(function* () {
240 const first = yield* scope.wrap({ command: "agent", args: [], name: "t", threadId: "a" });
241 units.set(unitOf(first), { activeState: "failed", result: "oom-kill" });
242 const second = yield* scope.wrap({ command: "agent", args: [], name: "t", threadId: "a" });
243 units.set(unitOf(second), { activeState: "active", result: "success" });
244 expect(yield* scope.oomKilled("a")).toBe(false);
245​
246 units.set(unitOf(second), { activeState: "failed", result: "oom-kill" });
247 expect(yield* scope.oomKilled("a")).toBe(true);
248 units.delete(unitOf(second));
249 expect(yield* scope.oomKilled("a")).toBe(true);
250​
251 yield* scope.clear("a");
252 expect(yield* scope.oomKilled("a")).toBe(false);
253 }),
254 ),
255 );
256​
257 it.effect(
258 "keeps shared Codex scopes running without attributing their OOM to the launch thread",
259 () =>
260 withFakeSystemd(({ scope, units, calls }) =>
261 Effect.gen(function* () {
262 const agent = yield* scope.wrap({ command: "agent", args: [], name: "t", threadId: "a" });
263 expect(agent.args).toContain("--property=OOMPolicy=stop");
264 units.set(unitOf(agent), { activeState: "failed", result: "oom-kill" });
265 expect(yield* scope.oomKilled("a")).toBe(true);
266​
267 const executable = String(agent.args.at(-1));
268 const codex = yield* launchCodex(scope, "a", {
269 PATH: NodePath.relative(process.cwd(), NodePath.dirname(executable)),
270 });
271 // Anchored to the cwd for systemd-run, with its ".." kept; it names the same file.
272 const anchored = String(codex.args.at(-2));
273 expect(NodePath.isAbsolute(anchored)).toBe(true);
274 expect(NodePath.resolve(anchored)).toBe(executable);
275 expect(codex.args).toContain("--property=OOMPolicy=continue");
276 expect(codex.args).not.toContain("--property=OOMPolicy=stop");
277 expect(codex.args).toContain("--property=TimeoutStopSec=10s");
278 expect(codex.args).toContain("--collect");
279 units.set(unitOf(codex), { activeState: "active", result: "success" });
280 expect(yield* scope.oomKilled("a")).toBe(false);
281 units.set(unitOf(codex), { activeState: "failed", result: "oom-kill" });
282 expect(yield* scope.oomKilled("a")).toBe(false);
283 expect(
284 calls.filter(([, verb, unit]) => verb === "show" && unit === unitOf(codex)),
285 ).toEqual([]);
286 }),
287 ),
288 );
289​
290 it.effect.skipIf(!symlinksSupported)(
291 "keeps a symlinked parent in absolute and relative executable paths",
292 () =>
293 withFakeSystemd(({ scope }) =>
294 Effect.gen(function* () {
295 const plain = yield* scope.wrap({ command: "agent", args: [], name: "t", threadId: "s" });
296 const bin = NodePath.dirname(String(plain.args.at(-1)));
297 NodeFS.mkdirSync(NodePath.join(bin, "real", "sub"), { recursive: true });
298 NodeFS.writeFileSync(NodePath.join(bin, "real", "agent"), "", { mode: 0o755 });
299 NodeFS.symlinkSync(NodePath.join(bin, "real", "sub"), NodePath.join(bin, "link"));
300 // The kernel follows the link before "..", so this names real/agent, not bin/agent.
301 const command = `${NodePath.join(bin, "link")}/../agent`;
302 const wrapped = yield* scope.wrap({ command, args: [], name: "t", threadId: "s" });
303 expect(wrapped.args.at(-1)).toBe(command);
304 // A relative path is anchored to the cwd the same way, without collapsing "..".
305 const relative = `${NodePath.relative(process.cwd(), NodePath.join(bin, "link"))}/../agent`;
306 const anchored = yield* scope.wrap({
307 command: relative,
308 args: [],
309 name: "t",
310 threadId: "s",
311 });
312 expect(anchored.args.at(-1)).toBe(`${process.cwd()}${NodePath.sep}${relative}`);
313 }),
314 ),
315 );
316​
317 it.effect.each([{ oomPolicy: true }, { oomPolicy: false }])(
318 "Force stop kills a thread's own scope but never a shared Codex scope (OOM policy $oomPolicy)",
319 ({ oomPolicy }) =>
320 withFakeSystemd(
321 ({ scope, units, calls, cgroupRoot }) =>
322 Effect.gen(function* () {
323 const agent = yield* scope.wrap({
324 command: "agent",
325 args: [],
326 name: "t",
327 threadId: "a",
328 });
329 exitedAgent(units, cgroupRoot, unitOf(agent), { populated: true, oomKills: 0 });
330 const codex = yield* launchCodex(scope, "b");
331 exitedAgent(units, cgroupRoot, unitOf(codex), { populated: true, oomKills: 0 });
332​
333 expect(yield* scope.kill("a")).toBe(true);
334 expect(
335 NodeFS.readFileSync(NodePath.join(cgroupRoot, unitOf(agent), "cgroup.kill"), "utf8"),
336 ).toBe("1");
337 expect(yield* scope.kill("b")).toBe(false);
338 expect(NodeFS.existsSync(NodePath.join(cgroupRoot, unitOf(codex), "cgroup.kill"))).toBe(
339 false,
340 );
341 expect(calls.filter(([, verb]) => verb === "kill")).toEqual([]);
342 }),
343 { oomPolicy },
344 ),
345 );
346​
347 it.effect("keeps a running scope while hundreds of other threads launch", () =>
348 withFakeSystemd(({ scope, units }) =>
349 Effect.gen(function* () {
350 const live = yield* scope.wrap({ command: "agent", args: [], name: "t", threadId: "live" });
351 units.set(unitOf(live), { activeState: "active", result: "success" });
352 for (let index = 0; index < 600; index++) {
353 yield* scope.wrap({ command: "agent", args: [], name: "t", threadId: `other-${index}` });
354 }
355 units.set(unitOf(live), { activeState: "failed", result: "oom-kill" });
356 expect(yield* scope.oomKilled("live")).toBe(true);
357 }),
358 ),
359 );
360​
361 it.effect("delegates every agent scope so rootless containers can manage their cgroups", () =>
362 withFakeSystemd(({ scope }) =>
363 Effect.gen(function* () {
364 const agent = yield* scope.wrap({ command: "agent", args: [], name: "t", threadId: "a" });
365 const codex = yield* launchCodex(scope, "a");
366 const terminal = yield* scope.wrap({
367 command: "agent",
368 args: [],
369 name: "terminal",
370 survivesRestart: true,
371 });
372 for (const launch of [agent, codex, terminal]) {
373 expect(launch.args).toContain("--property=Delegate=yes");
374 }
375 }),
376 ),
377 );
378​
379 it.effect("caps agent memory and yields CPU, disk, and tasks to the server", () =>
380 withFakeSystemd(({ scope, calls }) =>
381 Effect.gen(function* () {
382 yield* scope.wrap({ command: "agent", args: [], name: "t", threadId: "a" });
383 const setProperties = calls.filter(([, verb]) => verb === "set-property");
384 expect(setProperties).toEqual([
385 [
386 "--user",
387 "set-property",
388 "--runtime",
389 "app-t3code-agents.slice",
390 expect.stringMatching(/^MemoryHigh=\d+$/),
391 expect.stringMatching(/^MemoryMax=\d+$/),
392 ],
393 [
394 "--user",
395 "set-property",
396 "--runtime",
397 "app-t3code.slice",
398 "CPUWeight=10",
399 "IOWeight=10",
400 "TasksMax=25%",
401 ],
402 ]);
403 }),
404 ),
405 );
406​
407 it.effect("follows a live memory or swap change at the next launch", () => {
408 memory.total = 16 * GiB;
409 memory.swapKb = 2 * 1024 ** 2;
410 return withFakeSystemd(({ scope, calls, failingVerbs }) =>
411 Effect.gen(function* () {
412 const launch = scope.wrap({ command: "agent", args: [], name: "t", threadId: "a" });
413 const memoryLimits = () =>
414 calls
415 .filter(
416 ([, verb, , slice]) => verb === "set-property" && slice === "app-t3code-agents.slice",
417 )
418 .map((args) => args.slice(4));
419 yield* launch;
420 yield* launch;
421 expect(memoryLimits()).toEqual([[`MemoryHigh=${10 * GiB}`, `MemoryMax=${12 * GiB}`]]);
422​
423 // A VM balloon or `pct set --memory` grows RAM while the server keeps running.
424 memory.total = 22 * GiB;
425 failingVerbs.add("set-property");
426 yield* launch;
427 yield* launch;
428 failingVerbs.delete("set-property");
429 yield* launch;
430 yield* launch;
431 const grown = [`MemoryHigh=${16 * GiB}`, `MemoryMax=${18 * GiB}`];
432 expect(memoryLimits()).toEqual([
433 [`MemoryHigh=${10 * GiB}`, `MemoryMax=${12 * GiB}`],
434 grown,
435 grown,
436 grown,
437 ]);
438​
439 // Without swap, MemoryHigh only throttles; MemoryMax must OOM-kill the runaway.
440 memory.swapKb = 0;
441 yield* launch;
442 expect(memoryLimits().at(-1)).toEqual(["MemoryHigh=infinity", `MemoryMax=${18 * GiB}`]);
443 memory.swapKb = 2 * 1024 ** 2;
444 }),
445 );
446 });
447​
448 it.effect("stops agents a killed server left before startup completes", () =>
449 withFakeSystemd(
450 ({ scope, calls, stateDir }) =>
451 Effect.gen(function* () {
452 expect(stopsOf(calls)).toEqual([["--user", "stop", ownedAgentSlice(stateDir)]]);
453 const agent = yield* scope.wrap({ command: "agent", args: [], name: "t", threadId: "a" });
454 expect(sliceOf(agent)).toBe(ownedAgentSlice(stateDir));
455 expect(agent.args).toContain("--property=TimeoutStopSec=10s");
456 const terminal = yield* scope.wrap({
457 command: "agent",
458 args: [],
459 name: "terminal",
460 survivesRestart: true,
461 });
462 expect(sliceOf(terminal)).toBe("app-t3code-agents.slice");
463 expect(stopsOf(calls)).toHaveLength(1);
464 }),
465 { leftovers: true },
466 ),
467 );
468​
469 it.effect("leaves the slice to another live server sharing this home", () =>
470 withFakeSystemd(({ calls }) => Effect.sync(() => expect(stopsOf(calls)).toEqual([])), {
471 leftovers: true,
472 liveOwner: true,
473 }),
474 );
475​
476 it.effect("stops leftover processes only in an active agent scope", () =>
477 withFakeSystemd(({ scope, units, calls, cgroupRoot }) =>
478 Effect.gen(function* () {
479 const agent = yield* scope.wrap({ command: "agent", args: [], name: "t", threadId: "a" });
480 const unit = unitOf(agent);
481 expect(agent.unit).toBe(unit);
482​
483 yield* scope.stop("session-2.scope");
484 expect(calls.some((args) => args.includes("session-2.scope"))).toBe(false);
485 yield* scope.stop(unit);
486 exitedAgent(units, cgroupRoot, unit, { populated: false, oomKills: 0 });
487 yield* scope.stop(unit);
488 exitedAgent(units, cgroupRoot, unit, { populated: true, oomKills: 0 });
489 units.get(unit)!.activeState = "deactivating";
490 yield* scope.stop(unit);
491 expect(stopsOf(calls)).toEqual([]);
492​
493 units.get(unit)!.activeState = "active";
494 yield* scope.stop(unit);
495 expect(stopsOf(calls)).toEqual([["--user", "stop", "--no-block", unit]]);
496 expect(yield* scope.oomKilled("a")).toBe(false);
497 }),
498 ),
499 );
500​
501 it.effect.each([true, false])(
502 "cleans up an OOM exit without losing its diagnosis (OOMPolicy=%s)",
503 (oomPolicy) =>
504 withFakeSystemd(
505 ({ scope, units, calls, cgroupRoot }) =>
506 Effect.gen(function* () {
507 const agent = yield* scope.wrap({
508 command: "agent",
509 args: [],
510 name: "t",
511 threadId: "a",
512 });
513 const unit = unitOf(agent);
514 exitedAgent(units, cgroupRoot, unit, { populated: true, oomKills: undefined });
515 yield* scope.stop(unit);
516 expect(stopsOf(calls)).toEqual(
517 oomPolicy ? [] : [["--user", "stop", "--no-block", unit]],
518 );
519​
520 // The kernel records the kill before systemd records the OOM result.
521 exitedAgent(units, cgroupRoot, unit, { populated: true, oomKills: 1 });
522 yield* scope.stop(unit);
523 expect(stopsOf(calls)).toHaveLength(oomPolicy ? 0 : 2);
524​
525 if (oomPolicy) {
526 units.set(unit, { activeState: "failed", result: "oom-kill" });
527 expect(yield* scope.oomKilled("a")).toBe(true);
528 units.delete(unit);
529 expect(yield* scope.oomKilled("a")).toBe(true);
530 }
531 }),
532 { oomPolicy },
533 ),
534 );
535​
536 it.effect("reports failed daemon cleanup without failing session teardown", () => {
537 const warnings: Array<unknown> = [];
538 const logger = Logger.make(({ message }) => {
539 warnings.push(message);
540 });
541 return withFakeSystemd(
542 ({ scope, units, cgroupRoot }) =>
543 Effect.gen(function* () {
544 const agent = yield* scope.wrap({ command: "agent", args: [], name: "t", threadId: "a" });
545 exitedAgent(units, cgroupRoot, unitOf(agent), { populated: true, oomKills: 0 });
546 yield* scope.stop(unitOf(agent));
547 expect(warnings.flat()).toContain("Could not stop an exited agent's scope");
548 }).pipe(Effect.provide(Logger.layer([logger], { mergeWithExisting: false }))),
549 { stopFails: true },
550 );
551 });
552​
553 it.effect("leaves a quiet slice alone", () =>
554 withFakeSystemd(({ scope, calls }) =>
555 Effect.gen(function* () {
556 yield* scope.wrap({ command: "agent", args: [], name: "t", threadId: "a" });
557 expect(calls.filter(([, verb]) => verb === "stop")).toEqual([]);
558 }),
559 ),
560 );
561});