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
scout/forge:scout/598-test-agents-test-ts-fifty-concurrent-pus → main 2 commits fork
1 file
changed +9
−7
test/agents.test.ts +9 −7
| @@ -11,6 +11,7 @@ | ||
| 11 | 11 | * works. It checks that the unhappy path is bounded. |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | import { gitClientEnv } from "./helpers/git-client.ts"; | |
| 14 | 15 | import { afterAll, beforeAll, describe, expect, test } from "bun:test"; |
| 15 | 16 | import { mkdtemp, rm } from "node:fs/promises"; |
| 16 | 17 | import { tmpdir } from "node:os"; |
| @@ -92,7 +93,7 @@ describe("fifty agents at once", () => { | ||
| 92 | 93 | message: "init", |
| 93 | 94 | files: [{ path: "README.md", content: "# swarm\n" }], |
| 94 | 95 | }); |
| 95 | }); | |
| 96 | }, 30_000); | |
| 96 | 97 | |
| 97 | 98 | afterAll(async () => { |
| 98 | 99 | servers.stop(); |
| @@ -175,7 +176,7 @@ describe("fifty agents at once", () => { | ||
| 175 | 176 | |
| 176 | 177 | const clone = await Bun.spawn( |
| 177 | 178 | ["git", "clone", "--quiet", remote, join(clones, "work")], |
| 178 | { stdout: "ignore", stderr: "pipe" }, | |
| 179 | { stdout: "ignore", stderr: "pipe", env: gitClientEnv() }, | |
| 179 | 180 | ); |
| 180 | 181 | expect(await clone.exited).toBe(0); |
| 181 | 182 | const work = join(clones, "work"); |
| @@ -185,11 +186,12 @@ describe("fifty agents at once", () => { | ||
| 185 | 186 | const branch = `agent-${i}`; |
| 186 | 187 | await Bun.spawn(["git", "checkout", "--quiet", "-b", branch, "main"], { |
| 187 | 188 | cwd: work, |
| 189 | env: gitClientEnv(), | |
| 188 | 190 | stdout: "ignore", |
| 189 | 191 | stderr: "ignore", |
| 190 | 192 | }).exited; |
| 191 | 193 | 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" }) | |
| 193 | 195 | .exited; |
| 194 | 196 | await Bun.spawn( |
| 195 | 197 | [ |
| @@ -203,7 +205,7 @@ describe("fifty agents at once", () => { | ||
| 203 | 205 | "-m", |
| 204 | 206 | `agent ${i}`, |
| 205 | 207 | ], |
| 206 | { cwd: work, stdout: "ignore", stderr: "ignore" }, | |
| 208 | { cwd: work, env: gitClientEnv(), stdout: "ignore", stderr: "ignore" }, | |
| 207 | 209 | ).exited; |
| 208 | 210 | } |
| 209 | 211 | |
| @@ -211,7 +213,7 @@ describe("fifty agents at once", () => { | ||
| 211 | 213 | Array.from({ length: WRITERS }, (_, i) => |
| 212 | 214 | Bun.spawn( |
| 213 | 215 | ["git", "push", "--quiet", "origin", `agent-${i}:agent-${i}`], |
| 214 | { cwd: work, stdout: "pipe", stderr: "pipe" }, | |
| 216 | { cwd: work, env: gitClientEnv(), stdout: "pipe", stderr: "pipe" }, | |
| 215 | 217 | ), |
| 216 | 218 | ).map(async (proc) => ({ |
| 217 | 219 | code: await proc.exited, |
| @@ -297,7 +299,7 @@ describe("Idempotency-Key", () => { | ||
| 297 | 299 | .then((r) => r.json()) |
| 298 | 300 | .then((j) => (j as { token: string }).token); |
| 299 | 301 | await post("/api/v1/repos", { name: "retry", visibility: "public" }); |
| 300 | }); | |
| 302 | }, 30_000); | |
| 301 | 303 | |
| 302 | 304 | afterAll(async () => { |
| 303 | 305 | servers.stop(); |
| @@ -596,7 +598,7 @@ describe("rate limits over HTTP", () => { | ||
| 596 | 598 | redirect: "manual", |
| 597 | 599 | }); |
| 598 | 600 | cookie = (signin.headers.get("set-cookie") ?? "").split(";")[0] ?? ""; |
| 599 | }); | |
| 601 | }, 30_000); | |
| 600 | 602 | |
| 601 | 603 | afterAll(async () => { |
| 602 | 604 | servers.stop(); |
new above
offline