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

Flaky: test/reviews-states.test.ts #2133

Merged opened this

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

Merged

scout/forge:scout/2107-flaky-test-reviews-states-test-ts → main 2 commits fork 1 thread · 1 unresolved

  • Merged. scout/2107-flaky-test-reviews-states-test-ts was merged into main as 99c4e45.

Review

Sign in to review this change.
2 files changed +27 −6
scripts/gate.ts −5
@@ -60,11 +60,6 @@ export const EXCLUDED: readonly Exclusion[] = [
6060 { file: "test/probes.test.ts", reason: "not yet admitted", issue: 261 },
6161 { file: "test/prompts.test.ts", reason: "not yet admitted", issue: 261 },
6262 { 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 },
6863 {
6964 file: "test/reviews.test.ts",
7065 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", () => {
496496
497497 // ---- the outbox ----
498498
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
500526 const kinds = listEvents(app.db, { limit: 500 }).map((e) => e.kind);

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.

501527 expect(kinds).toContain("pull.reviewed");
502528 expect(kinds).toContain("pull.thread_resolved");

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs