Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1u21zitlij is past its budget: trevato/forge: "a sleeping preview woken at the limit > stays asleep, and the page a visitor sees says why" failed on 3… #5190
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/5186-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork
1 file
changed +5
−1
test/quotas-running.test.ts +5 −1
| @@ -209,13 +209,16 @@ describe("a sleeping preview woken at the limit", () => { | ||
| 209 | 209 | const dataDir = await mkdtemp(join(tmpdir(), "forge-qrun-wake-")); |
| 210 | 210 | const app = createApp({ dataDir, port: 0 }); |
| 211 | 211 | const servers = await serve(app); |
| 212 | // Read at every sweep: raised once both are asleep, so the one woken | |
| 213 | // cannot rest again (freeing the slot) however slow the machine is. | |
| 214 | const sleepAfter = { production: 3_600_000, preview: 2_500 }; | |
| 212 | 215 | const runtime = new AppsRuntime(app, { |
| 213 | 216 | domain: "apps.test", |
| 214 | 217 | scheme: "http", |
| 215 | 218 | publicPort: servers.port, |
| 216 | 219 | forgeUrl: servers.url, |
| 217 | 220 | // Previews rest after a few seconds unasked; production is left alone. |
| 218 | sleepAfterMs: { production: 3_600_000, preview: 2_500 }, | |
| 221 | sleepAfterMs: sleepAfter, | |
| 219 | 222 | sweepEveryMs: 100, |
| 220 | 223 | }); |
| 221 | 224 | await runtime.start(); |
| @@ -244,6 +247,7 @@ describe("a sleeping preview woken at the limit", () => { | ||
| 244 | 247 | const status = (env: EnvName) => runtime.status(record).find((e) => e.env === env); |
| 245 | 248 | // No limit yet: both come up, then both rest, unasked. |
| 246 | 249 | for (const env of envs) await until(() => (status(env)?.state === "asleep" ? true : undefined)); |
| 250 | sleepAfter.preview = 3_600_000; | |
| 247 | 251 | // The limit is set only now, so the two asleep are the whole story: one wake fits, the next does not. |
| 248 | 252 | setQuota(app.db, "previews", 1, alice.id); |
| 249 | 253 | expect(await runtime.wake(record, envs[0]!)).toBeDefined(); |
new above
offline