Public: anyone can read this; the crew can change it.
Flaky: test/reviews-states.test.ts #2133
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/2107-flaky-test-reviews-states-test-ts → main 2 commits fork 1 thread · 1 unresolved
2 files
changed +27
−6
scripts/gate.ts −5
| @@ -60,11 +60,6 @@ export const EXCLUDED: readonly Exclusion[] = [ | ||
| 60 | 60 | { file: "test/probes.test.ts", reason: "not yet admitted", issue: 261 }, |
| 61 | 61 | { file: "test/prompts.test.ts", reason: "not yet admitted", issue: 261 }, |
| 62 | 62 | { file: "test/public-url.test.ts", reason: "not yet admitted", issue: 261 }, |
| 63 | { | |
| 64 | file: "test/reviews-states.test.ts", | |
| 65 | reason: "red in random order: every verdict and resolution reaches the event outbox", | |
| 66 | issue: 2107, | |
| 67 | }, | |
| 68 | 63 | { |
| 69 | 64 | file: "test/reviews.test.ts", |
| 70 | 65 | reason: "red in random order: a posted review comment appears inline, anchored to its line", |
test/reviews-states.test.ts +27 −1
| @@ -496,7 +496,33 @@ describe("review states, and the merge they gate", () => { | ||
| 496 | 496 | |
| 497 | 497 | // ---- the outbox ---- |
| 498 | 498 | |
| 499 | test("every verdict and resolution reaches the event outbox", () => { | |
| 499 | test("every verdict and resolution reaches the event outbox", async () => { | |
| 500 | // Produce its own verdict and resolution rather than read what an | |
| 501 | // earlier test happened to leave behind. | |
| 502 | const number = await proposeFrom("bob", "outbox", "outbox\n", "outbox"); | |
| 503 | const pull = `/api/v1/repos/acme/lib/pulls/${number}`; | |
| 504 | expect( | |
| 505 | (await as("ada", "POST", `${pull}/review-states`, { state: "approved" })) | |
| 506 | .status, | |
| 507 | ).toBe(201); | |
| 508 | expect( | |
| 509 | ( | |
| 510 | await as("ada", "POST", `${pull}/reviews`, { | |
| 511 | body: "why?", | |
| 512 | path: "a.txt", | |
| 513 | line: 1, | |
| 514 | side: "new", | |
| 515 | }) | |
| 516 | ).status, | |
| 517 | ).toBe(201); | |
| 518 | const [first] = await read<{ anchor: string }[]>( | |
| 519 | await as("ada", "GET", `${pull}/reviews`), | |
| 520 | ); | |
| 521 | expect( | |
| 522 | (await as("ada", "POST", `${pull}/threads/${first!.anchor}/resolve`, {})) | |
| 523 | .status, | |
| 524 | ).toBe(200); | |
| 525 | ||
| 500 | 526 | const kinds = listEvents(app.db, { limit: 500 }).map((e) => e.kind); |
| 501 | 527 | expect(kinds).toContain("pull.reviewed"); |
| 502 | 528 | expect(kinds).toContain("pull.thread_resolved"); |
new above
offline
The assertion below only checks that the kinds exist anywhere in the last 500 events. Filter on this pull's number so the test fails if these specific actions stop emitting events.