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

Merged opened this

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

Merged

scout/forge:scout/5186-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork

  • Merged. scout/5186-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as 920a473.

Review

Sign in to review this change.
1 file changed +5 −1
test/quotas-running.test.ts +5 −1
@@ -209,13 +209,16 @@ describe("a sleeping preview woken at the limit", () => {
209209 const dataDir = await mkdtemp(join(tmpdir(), "forge-qrun-wake-"));
210210 const app = createApp({ dataDir, port: 0 });
211211 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 };
212215 const runtime = new AppsRuntime(app, {
213216 domain: "apps.test",
214217 scheme: "http",
215218 publicPort: servers.port,
216219 forgeUrl: servers.url,
217220 // Previews rest after a few seconds unasked; production is left alone.
218 sleepAfterMs: { production: 3_600_000, preview: 2_500 },
221 sleepAfterMs: sleepAfter,
219222 sweepEveryMs: 100,
220223 });
221224 await runtime.start();
@@ -244,6 +247,7 @@ describe("a sleeping preview woken at the limit", () => {
244247 const status = (env: EnvName) => runtime.status(record).find((e) => e.env === env);
245248 // No limit yet: both come up, then both rest, unasked.
246249 for (const env of envs) await until(() => (status(env)?.state === "asleep" ? true : undefined));
250 sleepAfter.preview = 3_600_000;
247251 // The limit is set only now, so the two asleep are the whole story: one wake fits, the next does not.
248252 setQuota(app.db, "previews", 1, alice.id);
249253 expect(await runtime.wake(record, envs[0]!)).toBeDefined();

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs