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

test/agents.test.ts: fifty concurrent pushes come back 'auth required' over the hook socket; find why and fix it, or exclude it by name #978

Closed opened this in answer to
Closed without merging

scout/forge:scout/598-test-agents-test-ts-fifty-concurrent-pus → main 2 commits fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
1 file changed +9 −7
test/agents.test.ts +9 −7
@@ -11,6 +11,7 @@
1111 * works. It checks that the unhappy path is bounded.
1212 */
1313
14 import { gitClientEnv } from "./helpers/git-client.ts";
1415 import { afterAll, beforeAll, describe, expect, test } from "bun:test";
1516 import { mkdtemp, rm } from "node:fs/promises";
1617 import { tmpdir } from "node:os";
@@ -92,7 +93,7 @@ describe("fifty agents at once", () => {
9293 message: "init",
9394 files: [{ path: "README.md", content: "# swarm\n" }],
9495 });
95 });
96 }, 30_000);
9697
9798 afterAll(async () => {
9899 servers.stop();
@@ -175,7 +176,7 @@ describe("fifty agents at once", () => {
175176
176177 const clone = await Bun.spawn(
177178 ["git", "clone", "--quiet", remote, join(clones, "work")],
178 { stdout: "ignore", stderr: "pipe" },
179 { stdout: "ignore", stderr: "pipe", env: gitClientEnv() },
179180 );
180181 expect(await clone.exited).toBe(0);
181182 const work = join(clones, "work");
@@ -185,11 +186,12 @@ describe("fifty agents at once", () => {
185186 const branch = `agent-${i}`;
186187 await Bun.spawn(["git", "checkout", "--quiet", "-b", branch, "main"], {
187188 cwd: work,
189 env: gitClientEnv(),
188190 stdout: "ignore",
189191 stderr: "ignore",
190192 }).exited;
191193 await Bun.write(join(work, `agent-${i}.txt`), `work from agent ${i}\n`);
192 await Bun.spawn(["git", "add", "."], { cwd: work, stdout: "ignore" })
194 await Bun.spawn(["git", "add", "."], { cwd: work, env: gitClientEnv(), stdout: "ignore" })
193195 .exited;
194196 await Bun.spawn(
195197 [
@@ -203,7 +205,7 @@ describe("fifty agents at once", () => {
203205 "-m",
204206 `agent ${i}`,
205207 ],
206 { cwd: work, stdout: "ignore", stderr: "ignore" },
208 { cwd: work, env: gitClientEnv(), stdout: "ignore", stderr: "ignore" },
207209 ).exited;
208210 }
209211
@@ -211,7 +213,7 @@ describe("fifty agents at once", () => {
211213 Array.from({ length: WRITERS }, (_, i) =>
212214 Bun.spawn(
213215 ["git", "push", "--quiet", "origin", `agent-${i}:agent-${i}`],
214 { cwd: work, stdout: "pipe", stderr: "pipe" },
216 { cwd: work, env: gitClientEnv(), stdout: "pipe", stderr: "pipe" },
215217 ),
216218 ).map(async (proc) => ({
217219 code: await proc.exited,
@@ -297,7 +299,7 @@ describe("Idempotency-Key", () => {
297299 .then((r) => r.json())
298300 .then((j) => (j as { token: string }).token);
299301 await post("/api/v1/repos", { name: "retry", visibility: "public" });
300 });
302 }, 30_000);
301303
302304 afterAll(async () => {
303305 servers.stop();
@@ -596,7 +598,7 @@ describe("rate limits over HTTP", () => {
596598 redirect: "manual",
597599 });
598600 cookie = (signin.headers.get("set-cookie") ?? "").split(";")[0] ?? "";
599 });
601 }, 30_000);
600602
601603 afterAll(async () => {
602604 servers.stop();

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs