e2e: per-test timescale speedup — FAST/CHAIN rates for pure arrival waits (v1.8.0)
CI / build + unit + e2e (pull_request) Successful in 6m3s

- actions/hover/two-planes: FAST=10_000 for expiry fast-forwards, landing
  waits and fly-home cleanups; queue: + CHAIN=4_000 for auto-chain
  observation, refuel test at explicit 2_000 with relaxed fuel bound
- map-interactions: FAST=50_000 chain hops (~3 min -> ~15 s per direction);
  crossing leg stays at SCALE and now sets it BEFORE dispatch (a leftover
  fast rate would let the dispatch tick consume most of the leg)
- hover fleet-row test asserts flying from the fly endpoint's own snapshot
  and freezes immediately instead of speeding up then freezing mid-leg
- two-planes parallel-flight: both-grounded poll after cleanup dispatches so
  afterEach heal no longer pays the range-edge return leg at SCALE
This commit is contained in:
2026-09-27 20:18:56 +00:00
parent b60006a949
commit 664906b8ce
7 changed files with 98 additions and 57 deletions
+14 -4
View File
@@ -23,6 +23,7 @@ test.beforeEach(async ({ page }) => { await authenticate(page); });
// guarantee the fleet is exactly one plane (the starter, grounded at EDDF) before and after.
const SCALE = 1000; // test rate for fast-forwarding legs — keeps flights to seconds of real time
const FAST = 10_000; // pure arrival waits (no mid-leg observation) — range-edge legs land in ~2.5 s
const WORLD = 24; // the fixed world rate (ISS-117) — must match lib/worldClock.ts
const HUB = 'EDDF'; // must match HUB_ICAO in lib/game/seed.ts
const STARTER = 'plane-starter'; // the seeded plane's id (lib/game/seed.ts)
@@ -349,7 +350,7 @@ test('two grounded planes: Load is one-click with a preselected plane; the picke
});
test('two planes fly in parallel and both deliver their packages', async ({ page }) => {
test.setTimeout(300_000); // self-heal + one long leg each way at scale 1000
test.setTimeout(300_000); // self-heal + range-edge legs fast-forwarded at 10_000×
const secondId = await buySecondPlaneViaUi(page);
// Full tanks for both — the starter's may be partial from an earlier run.
@@ -379,8 +380,9 @@ test('two planes fly in parallel and both deliver their packages', async ({ page
expect(s1.planes.find((p) => p.id === secondId)?.status).toBe('flying');
expect(s1.planes.find((p) => p.id === secondId)?.destIcao).toBe(farthest.icao);
// Fast-forward to the FIRST landing (the short hop)…
await setScale(page, SCALE);
// Fast-forward to the FIRST landing (the short hop)… FAST is safe here — pure arrival waits, and a
// lagged tick can only land a plane sooner. The range-edge leg takes ~2.5 s at this rate.
await setScale(page, FAST);
await expect
.poll(async () => ((await getState(page)).planes.some((p) => p.status === 'available')), {
timeout: 240_000,
@@ -403,9 +405,17 @@ test('two planes fly in parallel and both deliver their packages', async ({ page
// The outbound to the range edge left the tank nearly empty — top it back up (ISS-082 hook).
await setFuelFull(page, secondId);
// Cleanup: fly both home so the live instance stays in its onboarding state for later specs.
// Cleanup: fly both home so the live instance stays in its onboarding state for later specs. The legs
// dispatch at FAST (inherited above) — let them finish HERE, otherwise afterEach's heal pays the
// range-edge return leg at SCALE (~24 s).
expect((await page.request.post(`/api/planes/${secondId}/fly`, { data: { destIcao: HUB } })).status()).toBe(200);
expect((await page.request.post(`/api/planes/${STARTER}/fly`, { data: { destIcao: HUB } })).status()).toBe(200);
await expect
.poll(async () => ((await getState(page)).planes.every((p) => p.status === 'available')), {
timeout: 120_000,
message: 'waiting for both planes to land back at the hub',
})
.toBe(true);
});
// ISS-082 (v0.42.0): the "refuel section lists both planes" test is gone with the manual refuel UI —