@tokenoftrust/storefront-runner 2.4.4 → 2.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101,7 +101,8 @@ const TERMINAL = new Set<JobState>(["succeeded", "needs-developer", "stuck"]);
101
101
 
102
102
  /**
103
103
  * Polls until every job is terminal. On every sample asserts the tenant never has more than one
104
- * running job. Create stubs for later reads after this returns (see the eviction note below).
104
+ * active (running or awaiting) job per lane. Create stubs for later reads after this returns (see
105
+ * the eviction note below).
105
106
  */
106
107
  export async function waitTerminal(tenant: string, jobIds: string[], timeoutMs = 20_000): Promise<JobView[]> {
107
108
  const deadline = Date.now() + timeoutMs;
@@ -117,9 +118,11 @@ export async function waitTerminal(tenant: string, jobIds: string[], timeoutMs =
117
118
  await new Promise((resolve) => setTimeout(resolve, 25));
118
119
  continue;
119
120
  }
120
- const running = jobs.filter((j) => j.state === "running" || j.state === "awaiting-external").length;
121
- maxRunning = Math.max(maxRunning, running);
122
- expect(running, "running (or awaiting) jobs observed at once").toBeLessThanOrEqual(1);
121
+ const active = jobs.filter((j) => j.state === "running" || j.state === "awaiting-external");
122
+ maxRunning = Math.max(maxRunning, active.length);
123
+ for (const lane of ["live", "preview"]) {
124
+ expect(active.filter((j) => j.lane === lane).length, `active ${lane}-lane jobs observed at once`).toBeLessThanOrEqual(1);
125
+ }
123
126
  const wanted = jobIds.map((id) => jobs.find((j) => j.jobId === id));
124
127
  if (wanted.every((j) => j && TERMINAL.has(j.state))) return wanted as JobView[];
125
128
  if (Date.now() > deadline) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenoftrust/storefront-runner",
3
- "version": "2.4.4",
3
+ "version": "2.4.5",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "World-shareable storefront runner: multi-tenant renderer on Astro/Cloudflare. No control plane.",
6
6
  "packageManager": "pnpm@11.9.0",