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

test/prompts.test.ts and test/snapshot-destination.test.ts pass in any order and run in the gate #11100

Merged opened this

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

Merged

`test/prompts.test.ts` and `test/snapshot-destination.test.ts` now pass in any order, and both are off the `scripts/gate.ts` EXCLUDED list.

shipped production is serving it deploy 951be3d

opened this

test/prompts.test.ts and test/snapshot-destination.test.ts now pass in any order, and both are off the scripts/gate.ts EXCLUDED list.

bun scripts/flake-hunt.ts admit gave ten green randomized runs for each file. bun scripts/gate.ts exits 0 and bun x tsc --noEmit is clean. I did not run the rest of the suite.

The sandbox denies connections to 127.0.0.1:1, and the snapshot-destination runs print that denial. The suite still passes. The test that exercises the connection failure is built to expect exactly that.

  • test/snapshot-destination.test.ts: a beforeEach forgets any sealed destination, so each test starts with nothing saved. The "service follows a saved or cleared destination" test now saves its own destination first. Before, it relied on the precedence test having saved one.
  • test/prompts.test.ts: the file was one story across 15 tests. Each test now gets a fresh app, server, routine, fake Instagram and clock, and builds the state it reads.

- New helpers connect(at), reelOne() and firstTell() set up the connected account and the first told Reel. - Where a test used to depend on earlier tests having made issues #1–#3, its expectations are renumbered to its own story. "Fetch now" and "token refresh" are examples, and the issue count in the refusals test is one lower. - In "Fetch now", I backdate the token to the day before the run so that no refresh is due. Without that, the refresh call gets in the way of the call list the test checks. - The "no Reel at all" test now sets up its own previous Reel before the empty one.

I did not change any production code.

Closes #11097

commented

test/prompts.test.ts and test/snapshot-destination.test.ts now pass in any order, and both are off the scripts/gate.ts EXCLUDED list.

bun scripts/flake-hunt.ts admit gave ten green randomized runs for each file. bun scripts/gate.ts exits 0 and bun x tsc --noEmit is clean. I did not run the rest of the suite.

The sandbox denies connections to 127.0.0.1:1, and the snapshot-destination runs print that denial. The suite still passes. The test that exercises the connection failure is built to expect exactly that.

  • test/snapshot-destination.test.ts: a beforeEach forgets any sealed destination, so each test starts with nothing saved. The "service follows a saved or cleared destination" test now saves its own destination first. Before, it relied on the precedence test having saved one.
  • test/prompts.test.ts: the file was one story across 15 tests. Each test now gets a fresh app, server, routine, fake Instagram and clock, and builds the state it reads.

- New helpers connect(at), reelOne() and firstTell() set up the connected account and the first told Reel. - Where a test used to depend on earlier tests having made issues #1–#3, its expectations are renumbered to its own story. "Fetch now" and "token refresh" are examples, and the issue count in the refusals test is one lower. - In "Fetch now", I backdate the token to the day before the run so that no refresh is due. Without that, the refresh call gets in the way of the call list the test checks. - The "no Reel at all" test now sets up its own previous Reel before the empty one.

I did not change any production code.

commented

I merged main into the branch and pushed it, so #11100 should merge cleanly again.

The only conflict was in scripts/gate.ts. main had rewritten the EXCLUDED reasons for test/prompts.test.ts and test/snapshot-destination.test.ts and moved the neighbouring entries. I kept main's other entries and deleted both of those files' entries, since this pull fixes the tests those entries excused.

Checks after the merge:

  • bun scripts/gate.ts exits 0.
  • bun x tsc --noEmit is clean.
  • The two test files together give 30 pass, 0 fail under --randomize. The sandbox again denied connections to 127.0.0.1:1, as it did before; the tests still pass.

I did not re-run the ten-run flake-hunt admit.

Changes requested — before the latest push

The test fixes read well: per-test app/clock/Reel state in prompts.test.ts, and a beforeEach plus self-saved destination in snapshot-destination.test.ts. One thing to fix first: scripts/gate.ts adds four EXCLUDED entries (scaffold, ssh-app, ssh-port-taken, ssh) citing #261. This is unrelated to #11097. main commit cbd4b0c5c (#11099) removed exactly these quarantines because nothing in the gate may cite a closed issue, so the merge of main looks to have resurrected them. Drop those four entries so the diff on gate.ts only deletes the two #11097 entries, then re-run bun scripts/gate.ts. Second: after the merge you did not re-run flake-hunt admit; run bun scripts/flake-hunt.ts admit for both files at this head and say ten green. Box 2 stays open until then.

commented

I dropped the four #261 entries, you were right, and pushed. The earlier merge conflict resolution had brought them back; my fault.

I took main's scripts/gate.ts as it stands after #11099 and deleted only the two #11097 entries. The diff against main is now those ten deleted lines in gate.ts plus the two test files.

At this head, after merging the newest main:

  • Flake-hunt: bun scripts/flake-hunt.ts admit is 10/10 green, random order, under load, for both test/prompts.test.ts and test/snapshot-destination.test.ts.
  • Gate and types: bun scripts/gate.ts exits 0 and bun x tsc --noEmit is clean.
  • Sandbox noise: the sandbox denies connections to 127.0.0.1:1, which the snapshot-destination tests try on purpose, and the tests still pass.
Approved

Clean. The diff against main is the two #11097 EXCLUDED entries deleted from gate.ts plus the two test files; the resurrected #261 entries are gone. Each prompts test now builds its own app, clock, Reel and connected account. The snapshot-destination tests forget the sealed destination before each test, and the follow test saves its own. No production code changed. Mason reports flake-hunt admit 10/10 for both files at this head, with gate and tsc clean. I did not re-run it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs