Public: anyone can read this; the crew can change it.

A join that freezes a lent job is recorded with how long the freeze took #17956

opened this

Merged 19h 7m ago, live in production

scout/forge:scout/17950-a-join-that-freezes-a-lent-job-is-record → main 0 commits fork 3 threads · 3 unresolved

  • Merged. scout/17950-a-join-that-freezes-a-lent-job-is-record was merged into main as 80543a4.

Review

Sign in to review this change.
10 files changed +265 −9
docs/features/lent-runners.md +7
@@ -43,6 +43,13 @@ trust:
4343 (`src/games/lend_fit.ts`). Its authors are limited to the repository's writers, so an outside
4444 contributor's pull is never sent to it.
4545
46 When a player joins and the box's agent freezes a lent job (#17950), it tells the forge when the
47 player joined and when the job was frozen. The forge keeps both, the gap and the job
48 (`lent_pause`, [lent_pause.ts](../../src/checks/lent_pause.ts)) and the check's log, on the page and
49 in the terminal's run view, says `Paused for a player who joined; frozen 0.4 s after the join`.
50 Joins are kept per job, one row each, and at most five are told of; a later report of the same or an older join is dropped. The agent writes one `.lend.join.<job>` file per frozen job, so every guard tells its own.
51 That is not red and not a try.
52
4653 A runner A owns has no scope and claims as before. A `lent-` runner enrolled before scopes takes
4754 the defaults from the day it was enrolled.
4855
src/checks/lent_pause.ts added +55
@@ -0,0 +1,55 @@
1 /**
2 * A join that froze a lent job (#17950). The box's agent reads a join from `docker events` and
3 * freezes every job's cgroup at once; it then tells the forge when each happened (epoch
4 * milliseconds on the box's clock, so the gap between them is the box's own). The forge keeps
5 * both times, the gap and the job (`lent_pause`) and says it in the check's log. A pause is not a
6 * result and not a try: nothing here touches the job's claims.
7 */
8
9 import type { Database } from "bun:sqlite";
10
11 /** A freeze later than this after its join is not a reading to believe. */
12 const DELAY_MAX_MS = 3_600_000;
13
14 export interface Pause {
15 readonly joinedMs: number;
16 readonly frozenMs: number;
17 readonly delayMs: number;
18 }
19
20 /** The agent's `paused` field as a pause, or undefined when it is not two plausible instants. */
21 export function readPause(raw: unknown): Pause | undefined {
22 if (typeof raw !== "object" || raw === null) return undefined;
23 const { joinedMs, frozenMs } = raw as Record<string, unknown>;
24 if (!Number.isSafeInteger(joinedMs) || !Number.isSafeInteger(frozenMs)) return undefined;
25 const joined = joinedMs as number;
26 const frozen = frozenMs as number;
27 const delayMs = frozen - joined;
28 if (joined <= 0 || delayMs < 0 || delayMs > DELAY_MAX_MS) return undefined;
29 return { joinedMs: joined, frozenMs: frozen, delayMs };
30 }
31
32 /** The line the check's log and details carry. */
33 export const pauseWords = (p: Pause): string =>
34 `Paused for a player who joined; frozen ${(p.delayMs / 1000).toFixed(1)} s after the join`;
35
36 /** Joins kept per job; a job that is frozen more often than this is not told of again. */
37 const PAUSES_MAX = 5;
38
39 /**
40 * Keep a pause for a job: one row per job, with the joins counted (at most PAUSES_MAX), the
41 * latest join's instant and the slowest freeze. False (rejected, nothing written) when the join
42 * is not later than the last kept (a repeat or an old one) or the job has its share.
43 */
44 export function keepPause(db: Database, job: { readonly id: string; readonly runId: string }, p: Pause): boolean {
45 return (
46 db
47 .query(
48 `INSERT INTO lent_pause (job_id, run_id, joins, joined_ms, delay_ms) VALUES (?1, ?2, 1, ?3, ?4)
49 ON CONFLICT (job_id) DO UPDATE SET joins = joins + 1, joined_ms = excluded.joined_ms,
50 delay_ms = MAX(delay_ms, excluded.delay_ms)
51 WHERE excluded.joined_ms > joined_ms AND joins < ?5`,
52 )
53 .run(job.id, job.runId, p.joinedMs, p.delayMs, PAUSES_MAX).changes > 0
54 );
55 }
src/checks/lent_scope.ts +12 −2
@@ -155,7 +155,17 @@ export function scopeFacts(
155155 }
156156
157157 /** What lent runners have run for this forge, in numbers; "" while none is lent to it. */
158 export function lentLine(lent: { readonly runners: number; readonly coreMs: number; readonly todayCoreMs: number }): string {
158 export function lentLine(lent: {
159 readonly runners: number;
160 readonly coreMs: number;
161 readonly todayCoreMs: number;
162 readonly pauses?: number;
163 readonly slowestFreezeMs?: number;
164 }): string {
159165 if (lent.runners === 0) return "";
160 return `Lent in: ${lent.runners} lent runner${lent.runners === 1 ? "" : "s"}, ${coreMinutes(lent.coreMs)} core-min in all, ${coreMinutes(lent.todayCoreMs)} today.`;
166 const paused =
167 (lent.pauses ?? 0) === 0
168 ? ""
169 : ` Paused for a player who joined ${lent.pauses} time${lent.pauses === 1 ? "" : "s"}; slowest freeze ${((lent.slowestFreezeMs ?? 0) / 1000).toFixed(1)} s after the join.`;
170 return `Lent in: ${lent.runners} lent runner${lent.runners === 1 ? "" : "s"}, ${coreMinutes(lent.coreMs)} core-min in all, ${coreMinutes(lent.todayCoreMs)} today.${paused}`;
161171 }
src/checks/runner_jobs.ts +6 −2
@@ -281,14 +281,18 @@ export function resumeRunner(db: Database, runnerId: string): boolean {
281281 }
282282
283283 /** What lent runners have run for this forge: the line Capacity and Runners show. */
284 export function lentIn(db: Database, now: number): { runners: number; coreMs: number; todayCoreMs: number } {
284 export function lentIn(db: Database, now: number): { runners: number; coreMs: number; todayCoreMs: number; pauses: number; slowestFreezeMs: number } {
285285 const row = db
286286 .query<{ n: number; total: number | null; today: number | null }, [string]>(
287287 `SELECT COUNT(*) AS n, SUM(core_ms) AS total, SUM(CASE WHEN day = ?1 THEN day_core_ms ELSE 0 END) AS today
288288 FROM check_runner WHERE scope IS NOT NULL OR name LIKE 'lent-%'`,
289289 )
290290 .get(utcDay(now))!;
291 return { runners: row.n, coreMs: row.total ?? 0, todayCoreMs: row.today ?? 0 };
291 // Joins that froze a lent job (#17950), and the slowest freeze after one.
292 const paused = db
293 .query<{ n: number | null; slowest: number | null }, []>("SELECT SUM(joins) AS n, MAX(delay_ms) AS slowest FROM lent_pause")
294 .get()!;
295 return { runners: row.n, coreMs: row.total ?? 0, todayCoreMs: row.today ?? 0, pauses: paused.n ?? 0, slowestFreezeMs: paused.slowest ?? 0 };
292296 }
293297
294298 /** What a lent runner's greens are sampled by: its salt and how many jobs it has run. */
src/core/migration-pins/20261203080000-lent-pause.pin added +1
@@ -0,0 +1,1 @@
1 99bad9cd60cae88383ee9288630c89f35155ead4441bcd16a13b464987739cba
src/core/migrations/20261203080000-lent-pause.ts added +11
@@ -0,0 +1,11 @@
1 // Joins that froze a lent job (#17950): per job, how many were kept (at most a few), the latest
2 // join's instant, and the slowest freeze after one. One row per job, so it cannot grow by reports.
3 export default `
4 CREATE TABLE lent_pause (
5 job_id TEXT NOT NULL PRIMARY KEY,
6 run_id TEXT NOT NULL,
7 joins INTEGER NOT NULL,
8 joined_ms INTEGER NOT NULL,
9 delay_ms INTEGER NOT NULL
10 ) WITHOUT ROWID;
outdated

Key (job_id, joined_ms) lets rows grow without limit per job; and lentIn runs COUNT/MAX over the whole table on each page render. Key on job_id (latest or slowest) or enforce the per-job bound in keepPause.

11 `;
src/games/agent.sh +18 −4
@@ -1517,11 +1517,17 @@ lend_quiet() {
15171517 lend_unit() { echo "$LEND_CGROUP/forge-job-$1.service"; }
15181518 lend_freeze() { [ -e "$(lend_unit "$1")/cgroup.freeze" ] && echo 1 >"$(lend_unit "$1")/cgroup.freeze"; return 0; }
15191519 lend_thaw() { [ -e "$(lend_unit "$1")/cgroup.freeze" ] && echo 0 >"$(lend_unit "$1")/cgroup.freeze"; return 0; }
1520 # Every job's cgroup, at once: what a join does first.
1520 # Every job's cgroup, at once: what a join does first. The join's time (taken first) and the time
1521 # its freeze was done go, per job, to `.lend.join.<id>` as epoch milliseconds, for that job's guard
1522 # to tell the forge (#17950); a file is written for each cgroup actually frozen and none for the
1523 # rest, so one job's pause never stands in another's way.
15211524 lend_freeze_all() {
1522 local f
1525 local f id joined
1526 joined="$(($(date +%s%N) / 1000000))"
15231527 for f in "$LEND_CGROUP"/forge-job-*.service/cgroup.freeze; do
1524 [ -e "$f" ] && echo 1 >"$f"
1528 [ -e "$f" ] && echo 1 >"$f" || continue
1529 id="${f%/cgroup.freeze}"; id="${id##*/forge-job-}"; id="${id%.service}"
outdated

One shared .lend.join for every job: only the first guard that reads it reports, the rest lose their pause, and a second join overwrites the first. Write one file per job id, for each cgroup actually frozen.

1530 [[ "$id" =~ $SAFE ]] && echo "$joined $(($(date +%s%N) / 1000000))" >"$DIR/.lend.join.$id"
15251531 done
15261532 return 0
15271533 }
@@ -1689,10 +1695,17 @@ lend_step() {
16891695 # worker took none), the cgroup is frozen at once, and the job is stopped when memory is needed or
16901696 # it has been frozen too long. A quiet box thaws it again.
16911697 lend_guard() {
1692 local pid="$1" id="$2" beat=0 frozen=0 t
1698 local pid="$1" id="$2" beat=0 frozen=0 t jn fz
16931699 while kill -0 "$pid" 2>/dev/null; do
16941700 sleep "$LEND_LOOK"
16951701 t="$(date +%s)"
1702 # A join froze this job: when it joined and when it was frozen, once (#17950).
1703 if [ -s "$DIR/.lend.join.$id" ]; then
1704 read -r jn fz <"$DIR/.lend.join.$id"
1705 rm -f "$DIR/.lend.join.$id"
1706 [[ "$jn" =~ ^[0-9]{10,16}$ ]] && [[ "$fz" =~ ^[0-9]{10,16}$ ]] &&
1707 lend_post "$id" "$(jq -cn --argjson j "$jn" --argjson f "$fz" '{paused: {joinedMs: $j, frozenMs: $f}}')" || true
1708 fi
16961709 if ! lend_quiet; then
16971710 lend_freeze "$id"
16981711 [ "$frozen" = 0 ] && frozen="$t"
@@ -1766,6 +1779,7 @@ lend_job() {
17661779 out="$work/out"
17671780 mv "$work.env" "$work/env" 2>/dev/null || : >"$work/env"
17681781 EVICTED=0
1782 rm -f "$DIR/.lend.join.$id"
17691783 if ! lend_checkout "$id" "$tok" "$commit" "$base" "$depth" "$work"; then
17701784 lend_clean "$id" "$work"
17711785 lend_give "$id" abandon "the box could not fetch the commit"
src/http/api/runners.ts +5
@@ -36,6 +36,7 @@ import {
3636 wakeClaimers,
3737 type RunnerResult,
3838 } from "../../checks/runner_jobs.ts";
39 import { keepPause, pauseWords, readPause } from "../../checks/lent_pause.ts";
3940 import { readSeed } from "../../checks/runner_seeds.ts";
4041 import { notePhase, takeSessionTime } from "../../core/route_timing.ts";
4142 import { buildOf } from "../../kernel/version.ts";
@@ -278,6 +279,10 @@ export function runnerRoutes(router: Router<Handler>): void {
278279 .slice(0, LINES_MAX)
279280 : [];
280281 if (lines.length > 0) mine.ear.lines(str(input.step), lines);
282 // A join froze a lent job (#17950): kept with its gap, said once in the check's log. Not a
283 // result and not a try; the report may carry the end (`interrupted`) too.
284 const paused = mine.job.lent ? readPause(input.paused) : undefined;
285 if (paused !== undefined && keepPause(ctx.app.db, mine.job, paused)) mine.ear.lines("", [pauseWords(paused)]);

Any lent token can post unlimited distinct joinedMs for its job; each adds a row and a log line. Bound it per job (accept only a join newer than the last kept one, or keep one row per job) and test the flood.

281286 if (typeof input.interrupted === "string") {
282287 if (!interruptJob(ctx.app.db, mine.job.id, token, input.interrupted, Array.isArray(input.kept) ? input.kept : [])) return notFound();
283288 wakeClaimers(ctx.app);
test/game-lend-box.test.ts +17 −1
@@ -294,11 +294,27 @@ describe("a join meets the job in order", () => {
294294 "freeze at once, then stop when memory is needed; the job goes back as interrupted, never done or abandoned",
295295 async () => {
296296 const b = await box({ steps: [{ name: "check", command: "sleep 30" }] }, { eventAfter: 1.5 });
297 // Another job on the box, with a guard of its own elsewhere: its pause is its own file.
298 mkdirSync(join(b.cg, "forge-job-other.service"));
299 writeFileSync(join(b.cg, "forge-job-other.service", "cgroup.freeze"), "0\n");
297300 const started = Date.now();
298301 await b.run();
299302 expect(Date.now() - started).toBeLessThan(15_000);
303 // One file per frozen job: the other job's is still there for its guard; the first job's
304 // was read and removed by its own, and no shared file is left (#17950).
305 expect(readFileSync(join(b.dir, ".lend.join.other"), "utf8")).toMatch(/^\d{13} \d{13}\n$/);
306 expect(existsSync(join(b.dir, ".lend.join.job1"))).toBe(false);
307 expect(existsSync(join(b.dir, ".lend.join"))).toBe(false);
300308 const ends = b.seen.filter((s) => s.path === "/api/v1/runner/jobs/job1" && Object.keys(s.body).some((k) => k !== "step" && k !== "lines"));
301 expect(ends.map((e) => Object.keys(e.body))).toEqual([["interrupted", "kept"]]);
309 expect(ends.filter((e) => !("paused" in e.body)).map((e) => Object.keys(e.body))).toEqual([["interrupted", "kept"]]);
310 // The join is told with its time and the freeze's, before the stop (#17950).
311 const said = b.seen.filter((x) => x.path === "/api/v1/runner/jobs/job1" && "paused" in x.body);
312 expect(said).toHaveLength(1);
313 const { joinedMs, frozenMs } = said[0]!.body["paused"] as { joinedMs: number; frozenMs: number };
314 expect(joinedMs).toBeGreaterThan(started);
315 expect(frozenMs).toBeGreaterThanOrEqual(joinedMs);
316 expect(frozenMs - joinedMs).toBeLessThan(2_000);
317 expect(b.seen.indexOf(said[0]!)).toBeLessThan(b.seen.findIndex((x) => "interrupted" in x.body));
302318 // Frozen when it was stopped: the freeze came first.
303319 expect(readFileSync(join(b.cg, "forge-job-job1.service", "cgroup.freeze"), "utf8").trim()).toBe("1");
304320 expect(b.read("systemctl")).toContain("stop forge-job-job1.service freeze=1");
test/lent-pause.test.ts added +133
@@ -0,0 +1,133 @@
1 /**
2 * A join that froze a lent job (#17950): the agent says when the player joined and when the job
3 * was frozen; the forge keeps both with the gap and the job, and the check's log says it in plain
4 * words. The check stays green and the pause is no try.
5 */
6 import { afterAll, beforeAll, describe, expect, test } from "bun:test";
7 import { openPull } from "../src/actions/pulls.ts";
8 import { commitToBranch } from "../src/actions/repos.ts";
9 import { keepPause, pauseWords, readPause } from "../src/checks/lent_pause.ts";
10 import { lentLine } from "../src/checks/lent_scope.ts";
11 import { deskOf, enrolRunner, lentIn, type RunnerJob } from "../src/checks/runner_jobs.ts";
12 import { startChecks } from "../src/checks/service.ts";
13 import { readRunLog } from "../src/runs/log.ts";
14 import { checkJson, checksForge } from "./helpers/checks-forge.ts";
15 import { quietLogs } from "./helpers/globals.ts";
16 import { noCanary } from "./helpers/lent.ts";
17 import { setLoadSource } from "../src/checks/lent_yield.ts";
18
19 quietLogs();
20
21 const PAUSES_MAX = 5;
22 const f = checksForge("forge-lent-pause-");
23
24 const pausesOf = (jobId: string) =>
25 f.app.db
26 .query<{ joins: number; joinedMs: number; delayMs: number }, [string]>(
27 "SELECT joins, joined_ms AS joinedMs, delay_ms AS delayMs FROM lent_pause WHERE job_id = ?1",
28 )
29 .all(jobId);
30
31 const post = (path: string, token: string, body: unknown): Promise<Response> =>
32 fetch(`${f.servers.url}${path}`, {
33 method: "POST",
34 headers: { authorization: `Bearer ${token}`, "content-type": "application/json" },
35 body: JSON.stringify(body),
36 });
37
38 beforeAll(async () => {
39 // A lent runner waits while this machine is loaded (#16479): the test machine is idle.
40 setLoadSource(() => 0);
41 await f.checks.stop();
42 f.checks = startChecks(f.app, { forgeUrl: f.servers.url, concurrency: 1, placement: { mode: "runner", waitMs: 300 } });
43 const gate = await commitToBranch(f.app, f.alice, f.repo, {
44 message: "Declare the check",
45 files: [{ path: "forge.json", content: checkJson("echo ran") }],
46 });
47 if (!gate.ok) throw new Error(JSON.stringify(gate.error));
48 await f.settled((r) => r.commitOid === gate.value.commitOid, 30_000);
49 });
50
51 describe("what the agent says of a join", () => {
52 test("two instants a little apart are a pause, said in plain words; anything else is not", () => {
53 const p = readPause({ joinedMs: 1_800_000_000_000, frozenMs: 1_800_000_000_400 })!;
54 expect(p).toEqual({ joinedMs: 1_800_000_000_000, frozenMs: 1_800_000_000_400, delayMs: 400 });
55 expect(pauseWords(p)).toBe("Paused for a player who joined; frozen 0.4 s after the join");
56 expect(readPause({ joinedMs: 5, frozenMs: 4 })).toBeUndefined();
57 expect(readPause({ joinedMs: "1", frozenMs: 2 })).toBeUndefined();
58 expect(readPause({ joinedMs: 1, frozenMs: 1 + 4_000_000 })).toBeUndefined();
59 expect(readPause(null)).toBeUndefined();
60 });
61 });
62
63 describe("what a job may be told of", () => {
64 const job = { id: "j1", runId: "r1" };
65 const pause = (joinedMs: number, delayMs: number) => ({ joinedMs, frozenMs: joinedMs + delayMs, delayMs });
66 const rows = () => f.app.db.query<{ n: number }, []>("SELECT COUNT(*) AS n FROM lent_pause").get()!.n;
67
68 test("a flood of distinct joins keeps one row and at most PAUSES_MAX counted, the slowest freeze", () => {
69 let kept = 0;
70 for (let i = 1; i <= 500; i++) if (keepPause(f.app.db, job, pause(1_800_000_000_000 + i, i === 2 ? 900 : 100))) kept++;
71 expect(kept).toBe(PAUSES_MAX);
72 expect(rows()).toBe(1);
73 expect(pausesOf("j1")).toEqual([{ joins: PAUSES_MAX, joinedMs: 1_800_000_000_005, delayMs: 900 }]);
74 // Nor is an old join taken back in after the flood.
75 expect(keepPause(f.app.db, { id: "j2", runId: "r1" }, pause(1_800_000_000_010, 5))).toBe(true);
76 expect(keepPause(f.app.db, { id: "j2", runId: "r1" }, pause(1_800_000_000_009, 5))).toBe(false);
77 f.app.db.run("DELETE FROM lent_pause");
78 });
79 });
80
81 describe("a join during a running lent job", () => {
82 test("is kept with the job and its gap, shown in the check's log, and costs the check nothing", async () => {
83 const lent = enrolRunner(f.app.db, "lent-box", f.alice.id);
84 noCanary(f.app.db, lent.runner.id);
85 const asked = post("/api/v1/runner/claim", lent.token, { wait: 20, cells: true });
86 await f.until(() => deskOf(f.app).claimers.size > 0, "the runner waiting in its claim");
87 const made = await commitToBranch(f.app, f.alice, f.repo, { branch: "pause", message: "Add p", files: [{ path: "p.txt", content: "p\n" }] });
88 if (!made.ok) throw new Error(JSON.stringify(made.error));
89 const opened = await openPull(f.app, f.alice, f.repo, { title: "pause", body: "", baseBranch: "main", headBranch: "pause" });
90 if (!opened.ok) throw new Error(JSON.stringify(opened.error));
91 const claim = (await (await asked).json()) as { job: RunnerJob; token: string };
92 const door = `/api/v1/runner/jobs/${claim.job.id}`;
93 const joined = 1_800_000_000_000;
94
95 expect((await post(door, claim.token, { paused: { joinedMs: joined, frozenMs: joined + 400 } })).status).toBe(200);
96 // Said again, it is the same join; a reading that cannot be true is not kept.
97 expect((await post(door, claim.token, { paused: { joinedMs: joined, frozenMs: joined + 400 } })).status).toBe(200);
98 expect((await post(door, claim.token, { paused: { joinedMs: joined + 9, frozenMs: joined } })).status).toBe(200);
99 expect(pausesOf(claim.job.id)).toEqual([{ joins: 1, joinedMs: joined, delayMs: 400 }]);
100
101 // A flood of later joins over the door adds rows and log lines only up to the bound.
102 for (let i = 1; i <= 40; i++) await post(door, claim.token, { paused: { joinedMs: joined + i, frozenMs: joined + i + 10 } });
103 expect(pausesOf(claim.job.id)).toEqual([{ joins: PAUSES_MAX, joinedMs: joined + PAUSES_MAX - 1, delayMs: 400 }]);
104
105 expect((await post(door, claim.token, { done: { steps: [{ name: "check", ok: true, ms: 5 }], contained: true, note: "" } })).status).toBe(200);
106 const run = await f.settled((r) => r.commitOid === made.value.commitOid, 30_000);
107 expect(run.state).toBe("ok");
108 expect(run.attempt).toBe(0);
109 const lines = readRunLog(f.app.config.dataDir, run.id).lines;
110 expect(lines.filter((l) => l.startsWith("Paused for a player who joined"))).toHaveLength(PAUSES_MAX);
111 expect(lines).toContain("Paused for a player who joined; frozen 0.4 s after the join");
112 // Runners and Capacity (page and terminal) say it too.
113 expect(lentLine(lentIn(f.app.db, Date.now()))).toContain("Paused for a player who joined 5 times; slowest freeze 0.4 s after the join.");
114 // Kept after the check ended and its job left the desk.
115 expect(pausesOf(claim.job.id)).toHaveLength(1);
116 });
117
118 test("a runner that is not lent has no pause kept", async () => {
119 const plain = enrolRunner(f.app.db, "plain", f.alice.id);
120 const asked = post("/api/v1/runner/claim", plain.token, { wait: 20, cells: true });
121 await f.until(() => deskOf(f.app).claimers.size > 0, "the runner waiting in its claim");
122 const made = await commitToBranch(f.app, f.alice, f.repo, { branch: "plain", message: "Add q", files: [{ path: "q.txt", content: "q\n" }] });
123 if (!made.ok) throw new Error(JSON.stringify(made.error));
124 const opened = await openPull(f.app, f.alice, f.repo, { title: "plain", body: "", baseBranch: "main", headBranch: "plain" });
125 if (!opened.ok) throw new Error(JSON.stringify(opened.error));
126 const claim = (await (await asked).json()) as { job: RunnerJob; token: string };
127 await post(`/api/v1/runner/jobs/${claim.job.id}`, claim.token, { paused: { joinedMs: 1_800_000_000_000, frozenMs: 1_800_000_000_100 } });
128 expect(pausesOf(claim.job.id)).toEqual([]);
129 await post(`/api/v1/runner/jobs/${claim.job.id}`, claim.token, { done: { steps: [{ name: "check", ok: true, ms: 5 }], contained: true, note: "" } });
130 });
131 });
132
133 afterAll(() => setLoadSource());

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs