Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/maintenance/batch-e2e-peer-stamped-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- **test(batches):** boot the batch rate-limit E2E suite through the peer-stamped server (`run-next.mjs`) instead of bare `next dev`. Without the TCP-peer stamp the open-bootstrap management calls that seed its provider node and API key failed closed with 401, so the suite never reached an assertion. It is now pinned by a unit source-contract test (#11535, #14403 fixed the same trap in two sibling harnesses).
6 changes: 5 additions & 1 deletion tests/integration/batch-e2e-rate-limit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ function createServerProcess() {
const stderrLines: string[] = [];
let exitInfo: { code: number | null; signal: NodeJS.Signals | null } | null = null;

const child = spawn(process.execPath, ["scripts/dev/run-next-playwright.mjs", "dev"], {
// The management calls below (provider node + API key) only stay open in bootstrap mode for a
// loopback peer, and locality comes from the TCP-peer stamp that only the custom server in
// run-next.mjs writes. Bare `next dev` (run-next-playwright.mjs) has no stamp, so they fail
// closed with 401 — the same trap #11535 and #14403 fixed in the protocol and ecosystem harnesses.
const child = spawn(process.execPath, ["scripts/dev/run-next.mjs", "dev"], {
cwd: REPO_ROOT,
env: {
...process.env,
Expand Down
29 changes: 29 additions & 0 deletions tests/unit/batch-e2e-server-stamping.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* The batch E2E suite (tests/integration/batch-e2e-rate-limit.test.ts) seeds a provider node and
* mints an API key through the management API in open bootstrap mode. That window only stays open
* for a loopback peer, and locality is derived from the TCP-peer stamp that only the custom server
* in scripts/dev/run-next.mjs writes. Booted through run-next-playwright.mjs (bare `next dev`), the
* suite got `401` on `POST /api/provider-nodes` before a single assertion ran. Integration runs
* only on the release PR, so pin the boot target here where every PR sees it (#11535, #14403).
*/
import { readFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import test from "node:test";
import assert from "node:assert/strict";

const here = dirname(fileURLToPath(import.meta.url));
const suiteSource = readFileSync(
join(here, "..", "integration", "batch-e2e-rate-limit.test.ts"),
"utf8"
);

test("batch E2E boots the peer-stamped custom server, not the bare next CLI", () => {
assert.match(suiteSource, /spawn\(process\.execPath, \["scripts\/dev\/run-next\.mjs", "dev"\]/);
assert.doesNotMatch(suiteSource, /spawn\([^)]*run-next-playwright\.mjs/);
});

test("batch E2E pins the loopback host and open bootstrap the management calls rely on", () => {
assert.match(suiteSource, /HOST: "127\.0\.0\.1"/);
assert.match(suiteSource, /OMNIROUTE_E2E_BOOTSTRAP_MODE: "open"/);
});
Loading