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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3fmimn3rfl is past its budget: trevato/forge: "an answer git failed to give is not remembered" failed on 3 pulls in the last hour — the lane's red, no… #15896

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/15895-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 0 commits fork 1 thread · 1 unresolved

  • Merged. scout/15895-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as bf8a089.

Review

Sign in to review this change.
1 file changed +14 −9
test/following-cache.test.ts +14 −9
@@ -10,7 +10,7 @@ import { join } from "node:path";
1010 import { commitToBranch, createRepo, forkRepo } from "../src/actions/repos.ts";
1111 import { relationOf } from "../src/actions/forks.ts";
1212 import { createApp, type App } from "../src/app.ts";
13 import { comparisons } from "../src/core/following.ts";
13 import { comparisons, keptStanding } from "../src/core/following.ts";
1414 import { getRepo } from "../src/core/repos.ts";
1515 import { getUserByName } from "../src/core/users.ts";
1616 import { createUser } from "../src/core/users.ts";
@@ -100,12 +100,17 @@ test("an answer git failed to give is not remembered", async () => {
100100 const fork = getRepo(app.db, "bob", "lib")!;
101101 const bob = getUserByName(app.db, "bob")!;
102102 // A tip whose objects are missing: git cannot compare it with anything.
103 await writeFile(
104 join(repoDir(app.reposRoot, "bob", "lib"), `refs/heads/${fork.defaultBranch}`),
105 `${"c".repeat(40)}\n`,
106 );
107 const before = comparisons.count;
108 await relationOf(app, bob, fork);
109 await relationOf(app, bob, fork);
110 expect(comparisons.count).toBe(before + 2);
103 // A follow started by an earlier commit may still be moving this ref and
104 // overwrite the tip, so it is written again until a read has seen it.
105 const parent = getRepo(app.db, "alice", "lib")!;
106 const bogus = "c".repeat(40);
107 const ref = join(repoDir(app.reposRoot, "bob", "lib"), `refs/heads/${fork.defaultBranch}`);
108 let read = await relationOf(app, bob, fork);
109 for (let i = 0; i < 20 && read?.forkTip !== bogus; i++) {
110 await writeFile(ref, `${bogus}\n`);
111 read = await relationOf(app, bob, fork);
112 }
113 expect(read?.forkTip).toBe(bogus);
114 // What the forge kept for these two tips is nothing: git gave no answer.
115 expect(keptStanding(app, fork, parent)).toBeUndefined();
111116 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs