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

Full suite red: test/looks.test.ts #12764

Merged opened this in answer to

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

Merged

scout/forge:scout/12732-full-suite-red-test-looks-test-ts → main 2 commits fork 1 thread · 1 unresolved

  • Merged. scout/12732-full-suite-red-test-looks-test-ts was merged into main as 9d19e87.

Review

Sign in to review this change.
1 file changed +15 −3
test/looks.test.ts +15 −3
@@ -1089,7 +1089,7 @@ describe("the look", () => {
10891089 expect(existsSync(join(dataDir, path))).toBe(false);
10901090 });
10911091
1092 test("a look waits for the app to answer before its one capture; an app that never answers gets none and one recorded reason (#11520)", async () => {
1092 const answeringTrial = (answerWaitMs: number) => {
10931093 const status = runtime.envStatus(record, "production")!;
10941094 const head = status.commitOid;
10951095 const forgetPictures = () =>
@@ -1104,20 +1104,32 @@ describe("the look", () => {
11041104 return fake(input);
11051105 },
11061106 answers,
1107 answerWaitMs: 150,
1108 answerPollMs: 5,
1107 answerWaitMs,
outdated

answerWaitMs: 40 applies to both tests. The answering test needs four asks (about 6 ms of polling) inside 40 ms of wall time. A loaded CI machine can stall longer than that, and the capture is then never taken, so the test fails. Make the wait an argument to answeringTrial and give the answering test a wide one.

1108 answerPollMs: 2,
11091109 });
11101110 own.sweep();
11111111 await own.idle();
11121112 await own.stop();
11131113 return { seen, rows: looksForEnv(app.db, record.id, "production", "any").filter((l) => l.commitOid === head) };
11141114 };
1115 return { head, forgetPictures, trial };
1116 };
1117
1118 test("a look waits for the app to answer before its one capture (#11520)", async () => {
1119 // A wide wait: a stalled event loop under load must not spend it before the fourth ask.
1120 const { forgetPictures, trial } = answeringTrial(5_000);
11151121 // Answers on the fourth ask: no capture before it, then the pictures.
11161122 let asked = 0;
11171123 const slow = await trial(async () => ++asked >= 4);
11181124 expect(asked).toBe(4);
11191125 expect(slow.seen.filter((c) => c.dark !== true).length).toBeGreaterThan(0);
11201126 expect(slow.rows.every((l) => l.error === null)).toBe(true);
1127 forgetPictures();
1128 });
1129
1130 test("an app that never answers gets no capture and one recorded reason (#11520)", async () => {
1131 // A short wait: it only has to run out.
1132 const { forgetPictures, trial } = answeringTrial(40);
11211133 // Never answers: no browser, and the reason on record.
11221134 const mute = await trial(async () => false);
11231135 expect(mute.seen).toEqual([]);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs