Public: anyone can read this; the crew can change it.
Two tests red only beside others: the clog sentence skips repositories not on this forge, and the shard test runs outside a worker #17584
Merged 17h 47m ago, live in production
sold/recurring-reds → main 0 commits 1 thread · 1 unresolved
3 files
changed +18
−2
src/flow/clog_view.ts +2 −1
| @@ -73,7 +73,8 @@ export function readClogView(db: Database, now = new Date()): ClogView { | ||
| 73 | 73 | |
| 74 | 74 | const approved = new Set(approvedRows(db).map(key)); |
| 75 | 75 | const conflicted = conflictedPulls(db).filter((c) => approved.has(key(c))).length; |
| 76 | const hot = warmFiles().sort((a, b) => b.pulls - a.pulls || a.path.localeCompare(b.path))[0]; | |
| 76 | // The pull files are kept for the process, so a repository this database does not have is left out, as above. | |
| 77 | const hot = warmFiles().filter((f) => nameOf(f.repoId) !== "").sort((a, b) => b.pulls - a.pulls || a.path.localeCompare(b.path))[0]; | |
| 77 | 78 | const standing = readClog(db, now).standing; |
| 78 | 79 | // Checks stopped for CPU come first when they are the lane's main failure (#11617). |
| 79 | 80 | const cpu = cpuStopReason(cpuStops(db, now)); |
test/flow-clog-page.test.ts +13
| @@ -103,6 +103,19 @@ test("pulls touching the same files are listed as a pair, linked to both, and th | ||
| 103 | 103 | expect(html).toContain("3 open pulls touch src/a.ts"); |
| 104 | 104 | }); |
| 105 | 105 | |
| 106 | test("a repository that is not on this forge never takes the hottest file's place", async () => { | |
| 107 | // What another app in this process learned: its repository is not in this database. | |
| 108 | rememberPullFiles("not-on-this-forge", [901, 902, 903, 904, 905, 906].map((number) => ({ number, files: ["src/elsewhere.ts"] }))); | |
| 109 | try { | |
| 110 | const html = await page(); | |
| 111 | expect(html).toContain("3 open pulls touch src/a.ts"); | |
| 112 | expect(html).not.toContain("src/elsewhere.ts"); | |
| 113 | expect(flowLines(app.db).join("\n").replace(/\s*\n/g, " ")).toContain("3 open pulls touch src/a.ts"); | |
| 114 | } finally { | |
| 115 | rememberPullFiles("not-on-this-forge", []); | |
| 116 | } | |
| 117 | }); | |
| 118 | ||
| 106 | 119 | test("the bottleneck sentence appears when approved pulls conflict", async () => { |
| 107 | 120 | const p = pull(); |
| 108 | 121 | const issue = app.db.query<{ id: string }, [number]>("SELECT id FROM issue WHERE number = ?1").get(p)!; |
test/shards-parallel.test.ts +3 −1
| @@ -17,9 +17,11 @@ const script = new URL("../scripts/test-shards.ts", import.meta.url).pathname; | ||
| 17 | 17 | let dir = ""; |
| 18 | 18 | |
| 19 | 19 | const runner = async (args: string[], env: Record<string, string> = {}): Promise<{ code: number; out: string }> => { |
| 20 | // This file may itself run in a `--parallel` worker; the check starts the runner outside one. | |
| 21 | const { BUN_TEST_WORKER_ID: _bun, JEST_WORKER_ID: _jest, ...outside } = process.env; | |
| 20 | 22 | const child = Bun.spawn(["bun", script, ...args], { |
| 21 | 23 | cwd: dir, |
| 22 | env: { ...process.env, FORGE_CHECK_SHARDS: "2", FORGE_CHECK_SCRATCH: join(dir, "scratch"), ...env }, | |
| 24 | env: { ...outside, FORGE_CHECK_SHARDS: "2", FORGE_CHECK_SCRATCH: join(dir, "scratch"), ...env }, | |
| 23 | 25 | stdin: "ignore", |
| 24 | 26 | stdout: "pipe", |
| 25 | 27 | stderr: "pipe", |
new above
offline
Correct. Next: this line is long. Split the chain, and run
bun scripts/gate.ts --fixif the gate objects.