Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2ycx19qxfm is past its budget: trevato/forge: "verify an email from the People screen > an admin verifies the person under the cursor and the row chan… #7707
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/7669-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 2 commits fork
2 files
changed +20
−6
test/apps-rollout.test.ts +16 −6
| @@ -117,14 +117,21 @@ function connect(forge: Forge) { | ||
| 117 | 117 | return { ws, opened, closed, echo }; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | /** Ask `/` until `stop` is set, from whichever forge `target` names; every status seen. */ | |
| 121 | function loop(target: () => Forge, stop: { done: boolean }): Promise<number[]> { | |
| 120 | /** | |
| 121 | * Ask `/` until `stop` is set, from whichever forge `target` names; every | |
| 122 | * status seen. `stop.asking` is the request in flight, so a test can let it | |
| 123 | * land before it stops the forge it went to. | |
| 124 | */ | |
| 125 | function loop(target: () => Forge, stop: { done: boolean; asking?: Promise<unknown> }): Promise<number[]> { | |
| 122 | 126 | return (async () => { |
| 123 | 127 | const seen: number[] = []; |
| 124 | 128 | while (!stop.done) { |
| 125 | const res = await get(target(), "/"); | |
| 126 | await res.arrayBuffer(); | |
| 127 | seen.push(res.status); | |
| 129 | const asking = get(target(), "/").then(async (res) => { | |
| 130 | await res.arrayBuffer(); | |
| 131 | return res.status; | |
| 132 | }); | |
| 133 | stop.asking = asking; | |
| 134 | seen.push(await asking); | |
| 128 | 135 | await Bun.sleep(20); |
| 129 | 136 | } |
| 130 | 137 | return seen; |
| @@ -237,7 +244,7 @@ describe("apps: through a rollout", () => { | ||
| 237 | 244 | expect(await socket.opened).toBe(true); |
| 238 | 245 | expect(await socket.echo("held")).toBe("held"); |
| 239 | 246 | |
| 240 | const stop = { done: false }; | |
| 247 | const stop: { done: boolean; asking?: Promise<unknown> } = { done: false }; | |
| 241 | 248 | let current: Forge = a; |
| 242 | 249 | const statuses = loop(() => current, stop); |
| 243 | 250 | |
| @@ -259,6 +266,9 @@ describe("apps: through a rollout", () => { | ||
| 259 | 266 | |
| 260 | 267 | // The platform routes to the new forge; the old one stops its apps. |
| 261 | 268 | current = next; |
| 269 | // The request already sent to the old forge lands first, as the | |
| 270 | // SIGTERM linger in `main.ts` lets it in production (#4496). | |
| 271 | await stop.asking; | |
| 262 | 272 | await a.runtime.stop(); |
| 263 | 273 | a.presence.stop(); |
| 264 | 274 | const closed = await socket.closed; |
test/tui-people-verify.test.ts +4
| @@ -32,6 +32,10 @@ describe("verify an email from the People screen", () => { | ||
| 32 | 32 | alice = a.value; |
| 33 | 33 | bob = b.value; |
| 34 | 34 | markUnproven(forge.db, bob.id); |
| 35 | // The list is newest first, ties by username. Argon2 is cheap under test, | |
| 36 | // so both sign-ups can share a millisecond and put alice on top; the | |
| 37 | // cursor's first row must be bobby whatever the clock did. | |
| 38 | forge.db.query("UPDATE user SET created_at = '2000-01-01T00:00:00.000Z' WHERE id = ?1").run(alice.id); | |
| 35 | 39 | }); |
| 36 | 40 | |
| 37 | 41 | afterAll(async () => { |
new above
offline