@fairfox/polly 0.85.2 → 0.86.0
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.
- package/dist/src/client/index.js.map +2 -2
- package/dist/src/client/wrapper.d.ts +3 -3
- package/dist/src/elysia/index.d.ts +1 -1
- package/dist/src/elysia/types.d.ts +11 -2
- package/dist/src/peer.js +30 -1
- package/dist/src/peer.js.map +3 -3
- package/dist/src/shared/lib/peer-relay-adapter.d.ts +6 -0
- package/dist/tools/test/src/browser/run.js +12 -3
- package/dist/tools/test/src/browser/run.js.map +5 -4
- package/dist/tools/test/src/e2e-mesh/index.js +43 -7
- package/dist/tools/test/src/e2e-mesh/index.js.map +6 -5
- package/dist/tools/test/src/e2e-mesh/with-relay.d.ts +1 -1
- package/dist/tools/test/src/e2e-relay/index.js.map +1 -1
- package/dist/tools/test/src/e2e-shared/ephemeral-port.d.ts +73 -0
- package/dist/tools/test/src/e2e-shared/index.d.ts +1 -0
- package/dist/tools/test/src/index.d.ts +1 -0
- package/dist/tools/test/src/index.js +43 -1
- package/dist/tools/test/src/index.js.map +4 -3
- package/dist/tools/test/src/tiers/budget.d.ts +32 -0
- package/dist/tools/test/src/tiers/cli.js +35 -5
- package/dist/tools/test/src/tiers/cli.js.map +6 -5
- package/dist/tools/test/src/tiers/index.d.ts +1 -0
- package/dist/tools/test/src/tiers/reporter.d.ts +0 -5
- package/dist/tools/test/src/tiers/types.d.ts +9 -0
- package/dist/tools/verify/specs/README.md +18 -0
- package/dist/tools/verify/specs/tla/MeshState.cfg +1 -1
- package/dist/tools/verify/specs/tla/MeshState.tla +7 -0
- package/dist/tools/verify/specs/tla/MessageRouter.cfg +4 -2
- package/dist/tools/verify/specs/tla/MessageRouter.tla +45 -10
- package/dist/tools/verify/specs/tla/PeerState.cfg +1 -1
- package/dist/tools/verify/specs/tla/PeerState.tla +7 -0
- package/dist/tools/verify/specs/tla/README.md +1 -1
- package/dist/tools/verify/src/cli.js +235 -182
- package/dist/tools/verify/src/cli.js.map +10 -9
- package/dist/tools/verify/src/config.d.ts +25 -0
- package/dist/tools/verify/src/config.js.map +2 -2
- package/dist/tools/visualize/src/cli.js +437 -45
- package/dist/tools/visualize/src/cli.js.map +7 -5
- package/package.json +1 -1
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../tools/test/src/tiers/cli.ts", "../tools/test/src/tiers/args.ts", "../tools/test/src/tiers/discover.ts", "../tools/test/src/tiers/detect.ts", "../tools/test/src/tiers/order.ts", "../tools/test/src/tiers/protocol.ts", "../tools/test/src/tiers/engine.ts", "../tools/test/src/tiers/reporter.ts"],
|
|
3
|
+
"sources": ["../tools/test/src/tiers/cli.ts", "../tools/test/src/tiers/args.ts", "../tools/test/src/tiers/discover.ts", "../tools/test/src/tiers/budget.ts", "../tools/test/src/tiers/detect.ts", "../tools/test/src/tiers/order.ts", "../tools/test/src/tiers/protocol.ts", "../tools/test/src/tiers/engine.ts", "../tools/test/src/tiers/reporter.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"#!/usr/bin/env bun\n/**\n * Consumer-facing tiered test runner — what `polly test --tier …` runs from a\n * consumer's own Polly project. It auto-discovers the project's tiers (see\n * discover.ts) and runs them through the shared engine, exactly as Polly's own\n * internal suite does.\n *\n * Usage (from a Polly project root):\n * polly test --tier # discovered unit + integration (fast loop)\n * polly test --tier --all # every discovered tier\n * polly test --tier=browser # one tier\n * polly test --tier --all --order=cost # heaviest cases first (min wall-clock)\n * polly test --tier --all --fail-fast # soft early-stop on first failure\n * polly test --tier --list # show what was discovered, run nothing\n * polly test --tier --json # write test-results/tiers.json\n *\n * (Bare `polly test` still delegates to `bun test`; the --tier-family flags\n * switch into this runner.)\n */\nimport { mkdirSync } from \"node:fs\";\nimport { dirname } from \"node:path\";\nimport { parseTierArgs } from \"./args\";\nimport { discoverPlan } from \"./discover\";\nimport { runPlan } from \"./engine\";\nimport { formatPlan, formatSummary, toJSON } from \"./reporter\";\n\n/** Tiers run when no tier is named (fast inner loop), if they were discovered. */\nconst DEFAULT_TIERS = [\"unit\", \"integration\"];\n\nasync function main(): Promise<void> {\n const args = parseTierArgs(process.argv.slice(2));\n const root = process.cwd();\n const plan = await discoverPlan(root);\n\n if (plan.tiers.length === 0) {\n console.log(\n \"polly test: no tiers discovered.\\n\" +\n \" Looked for *.test.{ts,tsx}, *.browser.{ts,tsx}, and scripts/e2e-*.{ts,tsx}.\"\n );\n process.exit(0);\n }\n\n if (args.list) {\n console.log(formatPlan(plan));\n return;\n }\n\n const discovered = plan.tiers.map((t) => t.name);\n const known = new Set(discovered);\n let tiers: string[];\n if (args.tiers.length > 0) {\n const unknown = args.tiers.filter((t) => !known.has(t));\n if (unknown.length > 0) {\n console.log(`Unknown tier(s): ${unknown.join(\", \")}`);\n console.log(`Discovered tiers: ${discovered.join(\", \")}`);\n process.exit(2);\n }\n tiers = args.tiers;\n } else if (args.all || args.full) {\n tiers = discovered;\n } else {\n const fast = discovered.filter((t) => DEFAULT_TIERS.includes(t));\n tiers = fast.length > 0 ? fast : discovered;\n }\n\n console.log(\n `polly test — tiers: ${tiers.join(\" → \")}${args.only.length ? ` only: ${args.only.join(\", \")}` : \"\"}`\n );\n\n const report = await runPlan(plan, {\n tiers,\n only: args.only,\n // --fail-fast wants cheap, high-signal cases first so the abort trips\n // soonest; an explicit --order always wins.\n order: args.order ?? (args.failFast ? \"fast\" : \"default\"),\n bail: args.bail,\n failFast: args.failFast,\n strictNeeds: args.strictNeeds,\n cwd: root,\n log: (m) => console.log(m),\n });\n\n console.log(formatSummary(report));\n\n if (args.json) {\n mkdirSync(dirname(args.json), { recursive: true });\n await Bun.write(args.json, toJSON(report));\n console.log(`\\nwrote ${args.json}`);\n }\n\n process.exit(report.ok ? 0 : 1);\n}\n\nawait main();\n",
|
|
6
6
|
"/**\n * Shared flag parsing for the tiered runner CLIs.\n *\n * Both front-ends (Polly's internal scripts/test/cli.ts and the consumer-facing\n * tools/test/src/tiers/cli.ts) accept the same flags; only their tier *sets*\n * differ. This keeps the surface identical.\n */\n\nimport type { CaseOrder } from \"./types\";\n\nexport interface TierArgs {\n /** Explicit tier names (positional or via --tier=a,b). */\n tiers: string[];\n /** --only=substr filters across tiers. */\n only: string[];\n all: boolean;\n full: boolean;\n list: boolean;\n bail: boolean;\n /** --fail-fast: soft early-stop on the first failing case. */\n failFast: boolean;\n /** --order=fast|cost|default within-tier ordering, or null to leave unset. */\n order: CaseOrder | null;\n strictNeeds: boolean;\n /** Path to write JSON results, or null. */\n json: string | null;\n}\n\nexport const DEFAULT_JSON = \"test-results/tiers.json\";\n\nconst BOOL_FLAGS: Record<string, \"all\" | \"full\" | \"list\" | \"bail\" | \"failFast\" | \"strictNeeds\"> = {\n \"--all\": \"all\",\n \"--full\": \"full\",\n \"--list\": \"list\",\n \"--bail\": \"bail\",\n \"--fail-fast\": \"failFast\",\n \"--strict-needs\": \"strictNeeds\",\n};\n\n/** Narrow a raw `--order=` value to a {@link CaseOrder}, or null if unknown. */\nfunction parseOrder(value: string): CaseOrder | null {\n if (value === \"default\" || value === \"fast\" || value === \"cost\") return value;\n return null;\n}\n\nfunction listValue(arg: string, name: string): string[] {\n return arg.startsWith(name) ? arg.slice(name.length).split(\",\") : [];\n}\n\n/** Apply a value-bearing flag (`--name=value`, or bare `--json`). Returns false\n * if `arg` isn't one, so the caller can fall through to tier names. Exits(2) on\n * a malformed `--order=`. */\nfunction applyValueFlag(args: TierArgs, arg: string): boolean {\n if (arg === \"--json\") {\n args.json = DEFAULT_JSON;\n return true;\n }\n if (arg.startsWith(\"--json=\")) {\n args.json = arg.slice(\"--json=\".length);\n return true;\n }\n if (arg.startsWith(\"--tier=\")) {\n args.tiers.push(...listValue(arg, \"--tier=\"));\n return true;\n }\n if (arg.startsWith(\"--only=\")) {\n args.only.push(...listValue(arg, \"--only=\"));\n return true;\n }\n if (arg.startsWith(\"--order=\")) {\n const order = parseOrder(arg.slice(\"--order=\".length));\n if (order === null) {\n console.log(\"Unknown --order value (expected default, fast, or cost)\");\n process.exit(2);\n }\n args.order = order;\n return true;\n }\n return false;\n}\n\n/** Parse argv into {@link TierArgs}. Exits(2) on an unknown `--flag`. */\nexport function parseTierArgs(argv: string[]): TierArgs {\n const args: TierArgs = {\n tiers: [],\n only: [],\n all: false,\n full: false,\n list: false,\n bail: false,\n failFast: false,\n order: null,\n strictNeeds: false,\n json: null,\n };\n for (const arg of argv) {\n const boolKey = BOOL_FLAGS[arg];\n if (boolKey) {\n args[boolKey] = true;\n continue;\n }\n if (applyValueFlag(args, arg)) {\n continue;\n }\n if (arg.startsWith(\"-\")) {\n console.log(`Unknown flag: ${arg}`);\n process.exit(2);\n }\n args.tiers.push(arg);\n }\n return args;\n}\n",
|
|
7
7
|
"/**\n * Zero-config tier discovery for a consumer's Polly project.\n *\n * `polly test --tier` from a consumer's project builds its {@link TierPlan} by\n * convention — no config required:\n * - unit `bun test` (or `bun test tests/unit` if that dir exists)\n * - integration `bun test tests/integration` (when the dir exists)\n * - browser the Polly browser runner over `*.browser.{ts,tsx}`\n * - e2e `scripts/e2e-*.{ts,tsx}` exporting `run(ctx)` — the same\n * contract Polly dogfoods, so consumer e2e scripts written with\n * `@fairfox/polly/test` helpers slot straight in.\n *\n * A tier only appears when its inputs exist, so a project with just unit tests\n * gets just a unit tier.\n */\nimport { existsSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport type { CaseSpec, Tier, TierPlan } from \"./types\";\n\n/** Files matching `pattern` under `root`, excluding node_modules, sorted. */\nasync function globFiles(root: string, pattern: string): Promise<string[]> {\n const glob = new Bun.Glob(pattern);\n const out: string[] = [];\n for await (const file of glob.scan({ cwd: root, onlyFiles: true })) {\n if (file.includes(\"node_modules\") || file.startsWith(\"dist/\")) continue;\n out.push(file);\n }\n return out.sort();\n}\n\n/** Resolve the browser runner, preferring the bundled build. */\nfunction browserRunner(): string {\n const bundled = `${import.meta.dir}/../browser/run.js`;\n const source = `${import.meta.dir}/../browser/run.ts`;\n return existsSync(bundled) ? bundled : source;\n}\n\n/** Resolve the `polly bdd` CLI, preferring the bundled build. */\nfunction bddRunner(): string {\n const bundled = `${import.meta.dir}/../../../bdd/src/cli.js`;\n const source = `${import.meta.dir}/../../../bdd/src/cli.ts`;\n return existsSync(bundled) ? bundled : source;\n}\n\n/** A safe directory to hand the browser runner (never the project root, which\n * would make it scan node_modules). */\nfunction browserDir(root: string, files: string[]): string {\n if (existsSync(join(root, \"tests/browser\"))) return \"tests/browser\";\n if (existsSync(join(root, \"tests\"))) return \"tests\";\n return dirname(files[0] ?? \".\") || \".\";\n}\n\n/** `scripts/e2e-foo-bar.ts` → `foo-bar`. */\nfunction e2eId(file: string): string {\n const base = file.replace(/^.*\\//, \"\").replace(/\\.(ts|tsx)$/, \"\");\n return base.replace(/^e2e-/, \"\") || base;\n}\n\nexport async function discoverPlan(root: string): Promise<TierPlan> {\n const tiers: Tier[] = [];\n\n const hasUnitDir = existsSync(join(root, \"tests/unit\"));\n const hasIntegrationDir = existsSync(join(root, \"tests/integration\"));\n const testFiles = await globFiles(root, \"**/*.test.{ts,tsx}\");\n\n if (hasUnitDir) {\n tiers.push({\n name: \"unit\",\n description: \"bun test tests/unit\",\n cases: [\n { id: \"unit\", exec: { kind: \"command\", argv: [\"bun\", \"test\", \"tests/unit\"], cwd: root } },\n ],\n });\n } else if (testFiles.length > 0) {\n tiers.push({\n name: \"unit\",\n description: `bun test (${testFiles.length} files)`,\n cases: [{ id: \"unit\", exec: { kind: \"command\", argv: [\"bun\", \"test\"], cwd: root } }],\n });\n }\n\n if (hasIntegrationDir) {\n tiers.push({\n name: \"integration\",\n description: \"bun test tests/integration\",\n cases: [\n {\n id: \"integration\",\n exec: { kind: \"command\", argv: [\"bun\", \"test\", \"tests/integration\"], cwd: root },\n },\n ],\n });\n }\n\n const featureFiles = await globFiles(root, \"**/*.feature\");\n if (featureFiles.length > 0) {\n tiers.push({\n name: \"bdd\",\n description: `executable Gherkin (${featureFiles.length} *.feature file(s))`,\n timeoutMs: 120_000,\n cases: [\n {\n id: \"bdd\",\n tags: [\"bdd\", \"gherkin\"],\n exec: { kind: \"command\", argv: [\"bun\", bddRunner(), \"run\"], cwd: root },\n },\n ],\n });\n }\n\n const browserFiles = await globFiles(root, \"**/*.browser.{ts,tsx}\");\n if (browserFiles.length > 0) {\n tiers.push({\n name: \"browser\",\n description: `Puppeteer over ${browserFiles.length} *.browser file(s)`,\n timeoutMs: 180_000,\n cases: [\n {\n id: \"browser\",\n needs: [\"browser\"],\n exec: {\n kind: \"command\",\n argv: [\"bun\", browserRunner(), browserDir(root, browserFiles)],\n cwd: root,\n },\n },\n ],\n });\n }\n\n const e2eFiles = await globFiles(root, \"scripts/e2e-*.{ts,tsx}\");\n if (e2eFiles.length > 0) {\n const cases: CaseSpec[] = e2eFiles.map((file) => ({\n id: e2eId(file),\n tags: [\"e2e\"],\n exec: { kind: \"module\", modulePath: join(root, file) },\n }));\n tiers.push({\n name: \"e2e\",\n description: `run()-export scripts (${e2eFiles.length})`,\n concurrency: 2,\n timeoutMs: 240_000,\n cases,\n });\n }\n\n return { tiers };\n}\n",
|
|
8
|
+
"/**\n * Timeout budgets and the margin left against them.\n *\n * A fixed per-case timeout silently tightens every time the work it wraps\n * grows. `coverage.enforce` re-runs the whole unit suite under `--coverage`,\n * so its cost tracks that suite's size: it drifted to 83–86% of a 180s cap,\n * then crossed the line under load and failed an `--all` run that had no\n * coverage regression in it (polly#175).\n *\n * A duration is only legible next to its budget. The engine records\n * `timeoutMs` on every case report, and reports the ratio out loud once a\n * case passes {@link BUDGET_WARN_FRACTION} of it — so the margin erodes\n * visibly, one run at a time, instead of arriving as a red run.\n */\n\n/** Report the margin once a case has consumed this much of its budget. */\nexport const BUDGET_WARN_FRACTION = 0.7;\n\n/**\n * Fraction of its timeout a case consumed, or `undefined` when there is no\n * budget to measure against.\n */\nexport function budgetUse(durationMs: number, timeoutMs: number | undefined): number | undefined {\n if (typeof timeoutMs !== \"number\" || timeoutMs <= 0) return undefined;\n return durationMs / timeoutMs;\n}\n\n/**\n * A short \"how close was that\" note, or `undefined` when the case sat below\n * {@link BUDGET_WARN_FRACTION} and the margin needs no comment.\n *\n * @example\n * ```typescript\n * formatBudgetUse(154_235, 180_000); // \"86% of its 180000ms timeout budget\"\n * formatBudgetUse(4_633, 180_000); // undefined\n * ```\n */\nexport function formatBudgetUse(\n durationMs: number,\n timeoutMs: number | undefined\n): string | undefined {\n const used = budgetUse(durationMs, timeoutMs);\n if (used === undefined || used < BUDGET_WARN_FRACTION) return undefined;\n return `${Math.round(used * 100)}% of its ${timeoutMs}ms timeout budget`;\n}\n",
|
|
8
9
|
"/**\n * Host capability detection for need-gating.\n *\n * A case declaring `needs: [\"docker\"]` is skipped (not failed) when the host\n * can't satisfy it, unless `--strict-needs` is set. Detection is cached for the\n * lifetime of the process so a 30-case run probes `docker info` once.\n */\nimport type { Need } from \"./types\";\n\nconst cache = new Map<Need, boolean>();\n\nasync function commandSucceeds(argv: string[]): Promise<boolean> {\n try {\n const proc = Bun.spawn(argv, { stdout: \"ignore\", stderr: \"ignore\", stdin: \"ignore\" });\n return (await proc.exited) === 0;\n } catch {\n return false;\n }\n}\n\nasync function probe(need: Need): Promise<boolean> {\n switch (need) {\n case \"docker\":\n // `docker info` fails fast when the daemon is down, unlike `docker --version`.\n return commandSucceeds([\"docker\", \"info\"]);\n case \"browser\":\n // Puppeteer ships Chromium as a devDependency; assume present in-repo.\n // A real probe would resolve the executable path, but that pulls puppeteer\n // into the engine. Front-ends that need a stricter check can override.\n return true;\n case \"network\":\n return true;\n default:\n return false;\n }\n}\n\n/** Resolve whether a need is satisfied, memoised. */\nexport async function hasNeed(need: Need): Promise<boolean> {\n const cached = cache.get(need);\n if (cached !== undefined) return cached;\n const result = await probe(need);\n cache.set(need, result);\n return result;\n}\n\n/** First unmet need among `needs`, or null if all are satisfied. */\nexport async function firstUnmetNeed(needs: Need[] | undefined): Promise<Need | null> {\n for (const need of needs ?? []) {\n if (!(await hasNeed(need))) return need;\n }\n return null;\n}\n",
|
|
9
10
|
"/**\n * Within-tier case ordering.\n *\n * The engine drains a tier's cases through a bounded pool in array order, so\n * where a case sits decides when it launches. Reordering by a coarse cost hint\n * buys two different things depending on intent:\n *\n * - \"cost\" (heaviest first): the long poles launch in the first `concurrency`\n * slots and everything cheaper packs in behind them, so wall-clock collapses\n * toward the single slowest case instead of the sum. Use for a full run.\n * - \"fast\" (lightest first): cheap, high-signal cases run first, so under\n * soft-fail-fast they trip the abort soonest — you can't un-spawn a 4-minute\n * case, so you want it to *not* have started when a 2-second case fails.\n * - \"default\": registry definition order, unchanged.\n *\n * Pure and dependency-free on purpose: this is the one piece of the engine that\n * is worth unit-testing in isolation, and keeping it out of engine.ts keeps the\n * subprocess-heavy engine off the unit-coverage table.\n */\nimport type { CaseOrder, CaseSpec } from \"./types\";\n\nconst COST_WEIGHT: Record<NonNullable<CaseSpec[\"cost\"]>, number> = {\n light: 0,\n medium: 1,\n heavy: 2,\n};\n\n/** Weight of a case; unset cost is treated as \"medium\". */\nfunction weightOf(spec: CaseSpec): number {\n return COST_WEIGHT[spec.cost ?? \"medium\"];\n}\n\n/**\n * Return a copy of `cases` reordered per `order`. Stable: cases of equal weight\n * keep their original relative order, and \"default\" returns the input as-is.\n */\nexport function orderCases(cases: CaseSpec[], order: CaseOrder): CaseSpec[] {\n if (order === \"default\") return cases;\n const direction = order === \"cost\" ? -1 : 1; // cost → heaviest first; fast → lightest first\n return cases\n .map((spec, index) => ({ spec, index }))\n .sort((a, b) => (weightOf(a.spec) - weightOf(b.spec)) * direction || a.index - b.index)\n .map((entry) => entry.spec);\n}\n",
|
|
10
11
|
"/**\n * The one shared constant between the engine and its subprocess worker.\n *\n * It lives in its own leaf module so the engine never has to *import* the\n * worker (only spawn it by path). If the engine imported the worker, a\n * `splitting: false` bundle would inline the worker's `import.meta.main`\n * self-exec block into the CLI bundle and run it on startup. Keeping the\n * sentinel here avoids that.\n */\nexport const SENTINEL = \"__TIER_RESULT__\";\n",
|
|
11
|
-
"/**\n * The tiered test engine.\n *\n * Runs a {@link TierPlan} tier-by-tier in order. Within a tier, cases run with\n * bounded concurrency. Each case is its own subprocess (see worker.ts) so the\n * isolation the e2e scripts assume is preserved. Cases whose host needs are\n * unmet are skipped (logged), not failed, unless `strictNeeds` is set.\n */\nimport { firstUnmetNeed } from \"./detect\";\nimport { orderCases } from \"./order\";\nimport { SENTINEL } from \"./protocol\";\nimport type {\n CaseOutcome,\n CaseReport,\n CaseSpec,\n EngineOptions,\n RunReport,\n Tier,\n TierPlan,\n} from \"./types\";\n\nconst DEFAULT_TIMEOUT_MS = 120_000;\n\nasync function workerPath(): Promise<string> {\n const bundled = `${import.meta.dir}/worker.js`;\n const source = `${import.meta.dir}/worker.ts`;\n return (await Bun.file(bundled).exists()) ? bundled : source;\n}\n\nfunction caseLabel(spec: CaseSpec): string {\n return spec.label ?? spec.id;\n}\n\nfunction caseMatches(spec: CaseSpec, only: string[] | undefined): boolean {\n if (!only || only.length === 0) return true;\n const haystacks = [spec.id, caseLabel(spec), ...(spec.tags ?? [])].map((s) => s.toLowerCase());\n return only.some((needle) => {\n const n = needle.toLowerCase();\n return haystacks.some((h) => h.includes(n));\n });\n}\n\ninterface SubprocOutcome {\n exitCode: number;\n stdout: string;\n timedOut: boolean;\n}\n\nasync function runSubprocess(\n argv: string[],\n opts: { cwd?: string; env: Record<string, string | undefined>; timeoutMs: number },\n onLine: (line: string) => void\n): Promise<SubprocOutcome> {\n const proc = Bun.spawn(argv, {\n cwd: opts.cwd,\n env: opts.env,\n stdout: \"pipe\",\n stderr: \"pipe\",\n stdin: \"ignore\",\n });\n\n let timedOut = false;\n const timer = setTimeout(() => {\n timedOut = true;\n proc.kill();\n }, opts.timeoutMs);\n\n const chunks: string[] = [];\n const pump = async (stream: ReadableStream<Uint8Array>): Promise<void> => {\n const decoder = new TextDecoder();\n let buffered = \"\";\n for await (const chunk of stream) {\n buffered += decoder.decode(chunk, { stream: true });\n let nl = buffered.indexOf(\"\\n\");\n while (nl !== -1) {\n const line = buffered.slice(0, nl);\n chunks.push(line);\n onLine(line);\n buffered = buffered.slice(nl + 1);\n nl = buffered.indexOf(\"\\n\");\n }\n }\n if (buffered) {\n chunks.push(buffered);\n onLine(buffered);\n }\n };\n\n await Promise.all([pump(proc.stdout), pump(proc.stderr)]);\n const exitCode = await proc.exited;\n clearTimeout(timer);\n\n return { exitCode, stdout: chunks.join(\"\\n\"), timedOut };\n}\n\nfunction parseSentinel(stdout: string): { pass: boolean; message?: string } | null {\n const idx = stdout.lastIndexOf(SENTINEL);\n if (idx === -1) return null;\n const after = stdout.slice(idx + SENTINEL.length);\n const newline = after.indexOf(\"\\n\");\n const json = newline === -1 ? after : after.slice(0, newline);\n try {\n const parsed = JSON.parse(json.trim());\n return { pass: Boolean(parsed.pass), message: parsed.message };\n } catch {\n return null;\n }\n}\n\ninterface Verdict {\n outcome: CaseOutcome;\n message?: string;\n}\n\nconst VERDICT_ICON: Record<CaseOutcome, string> = {\n pass: \"✓\",\n fail: \"✗\",\n skip: \"⊘\",\n timeout: \"⏱\",\n};\n\n/** Resolve argv + cwd for a case, falling back to the run-wide cwd. */\nfunction buildInvocation(\n spec: CaseSpec,\n worker: string,\n options: EngineOptions\n): { argv: string[]; cwd?: string } {\n if (spec.exec.kind === \"module\") {\n return { argv: [\"bun\", worker, spec.exec.modulePath, spec.id], cwd: options.cwd };\n }\n return { argv: spec.exec.argv, cwd: spec.exec.cwd ?? options.cwd };\n}\n\n/** Decide pass/fail/timeout, preferring the sentinel over the exit code. */\nfunction decideVerdict(spec: CaseSpec, result: SubprocOutcome, timeoutMs: number): Verdict {\n if (result.timedOut) return { outcome: \"timeout\", message: `timed out after ${timeoutMs}ms` };\n const sentinel = spec.exec.kind === \"module\" ? parseSentinel(result.stdout) : null;\n const pass = sentinel ? sentinel.pass : result.exitCode === 0;\n if (pass) return { outcome: \"pass\" };\n return { outcome: \"fail\", message: sentinel?.message ?? `exit code ${result.exitCode}` };\n}\n\nasync function runOneCase(\n spec: CaseSpec,\n tier: Tier,\n options: EngineOptions,\n worker: string\n): Promise<CaseReport> {\n const label = caseLabel(spec);\n const log = options.log ?? ((m: string) => console.log(m));\n\n const unmet = await firstUnmetNeed(spec.needs);\n if (unmet && !options.strictNeeds) {\n log(` ⊘ ${label} — skipped (needs ${unmet})`);\n return {\n tier: tier.name,\n id: spec.id,\n label,\n outcome: \"skip\",\n durationMs: 0,\n skipReason: `needs ${unmet}`,\n };\n }\n\n const timeoutMs = spec.timeoutMs ?? tier.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n const env: Record<string, string | undefined> = {
|
|
12
|
-
"/**\n * Reporting for engine runs: a human summary table (with per-case timing and a\n * slowest-N list, the data the old `&&` chains never captured) and a JSON\n * artefact for tooling. No cloud reporters — everything lands on disk locally.\n */\nimport type { RunReport, TierPlan } from \"./types\";\n\nconst ICON = { pass: \"✓\", fail: \"✗\", skip: \"⊘\", timeout: \"⏱\" } as const;\n\n/** One-line-per-case summary plus totals and slowest cases. */\nexport function formatSummary(report: RunReport): string {\n const lines: string[] = [];\n lines.push(\"\");\n lines.push(\"── results ─────────────────────────────────\");\n for (const c of report.cases) {\n const time = c.outcome === \"skip\" ? \"\" : `${c.durationMs}ms`;\n
|
|
12
|
+
"/**\n * The tiered test engine.\n *\n * Runs a {@link TierPlan} tier-by-tier in order. Within a tier, cases run with\n * bounded concurrency. Each case is its own subprocess (see worker.ts) so the\n * isolation the e2e scripts assume is preserved. Cases whose host needs are\n * unmet are skipped (logged), not failed, unless `strictNeeds` is set.\n */\nimport { formatBudgetUse } from \"./budget\";\nimport { firstUnmetNeed } from \"./detect\";\nimport { orderCases } from \"./order\";\nimport { SENTINEL } from \"./protocol\";\nimport type {\n CaseOutcome,\n CaseReport,\n CaseSpec,\n EngineOptions,\n RunReport,\n Tier,\n TierPlan,\n} from \"./types\";\n\nconst DEFAULT_TIMEOUT_MS = 120_000;\n\nasync function workerPath(): Promise<string> {\n const bundled = `${import.meta.dir}/worker.js`;\n const source = `${import.meta.dir}/worker.ts`;\n return (await Bun.file(bundled).exists()) ? bundled : source;\n}\n\nfunction caseLabel(spec: CaseSpec): string {\n return spec.label ?? spec.id;\n}\n\nfunction caseMatches(spec: CaseSpec, only: string[] | undefined): boolean {\n if (!only || only.length === 0) return true;\n const haystacks = [spec.id, caseLabel(spec), ...(spec.tags ?? [])].map((s) => s.toLowerCase());\n return only.some((needle) => {\n const n = needle.toLowerCase();\n return haystacks.some((h) => h.includes(n));\n });\n}\n\ninterface SubprocOutcome {\n exitCode: number;\n stdout: string;\n timedOut: boolean;\n}\n\nasync function runSubprocess(\n argv: string[],\n opts: { cwd?: string; env: Record<string, string | undefined>; timeoutMs: number },\n onLine: (line: string) => void\n): Promise<SubprocOutcome> {\n const proc = Bun.spawn(argv, {\n cwd: opts.cwd,\n env: opts.env,\n stdout: \"pipe\",\n stderr: \"pipe\",\n stdin: \"ignore\",\n });\n\n let timedOut = false;\n const timer = setTimeout(() => {\n timedOut = true;\n proc.kill();\n }, opts.timeoutMs);\n\n const chunks: string[] = [];\n const pump = async (stream: ReadableStream<Uint8Array>): Promise<void> => {\n const decoder = new TextDecoder();\n let buffered = \"\";\n for await (const chunk of stream) {\n buffered += decoder.decode(chunk, { stream: true });\n let nl = buffered.indexOf(\"\\n\");\n while (nl !== -1) {\n const line = buffered.slice(0, nl);\n chunks.push(line);\n onLine(line);\n buffered = buffered.slice(nl + 1);\n nl = buffered.indexOf(\"\\n\");\n }\n }\n if (buffered) {\n chunks.push(buffered);\n onLine(buffered);\n }\n };\n\n await Promise.all([pump(proc.stdout), pump(proc.stderr)]);\n const exitCode = await proc.exited;\n clearTimeout(timer);\n\n return { exitCode, stdout: chunks.join(\"\\n\"), timedOut };\n}\n\nfunction parseSentinel(stdout: string): { pass: boolean; message?: string } | null {\n const idx = stdout.lastIndexOf(SENTINEL);\n if (idx === -1) return null;\n const after = stdout.slice(idx + SENTINEL.length);\n const newline = after.indexOf(\"\\n\");\n const json = newline === -1 ? after : after.slice(0, newline);\n try {\n const parsed = JSON.parse(json.trim());\n return { pass: Boolean(parsed.pass), message: parsed.message };\n } catch {\n return null;\n }\n}\n\ninterface Verdict {\n outcome: CaseOutcome;\n message?: string;\n}\n\nconst VERDICT_ICON: Record<CaseOutcome, string> = {\n pass: \"✓\",\n fail: \"✗\",\n skip: \"⊘\",\n timeout: \"⏱\",\n};\n\n/** Resolve argv + cwd for a case, falling back to the run-wide cwd. */\nfunction buildInvocation(\n spec: CaseSpec,\n worker: string,\n options: EngineOptions\n): { argv: string[]; cwd?: string } {\n if (spec.exec.kind === \"module\") {\n return { argv: [\"bun\", worker, spec.exec.modulePath, spec.id], cwd: options.cwd };\n }\n return { argv: spec.exec.argv, cwd: spec.exec.cwd ?? options.cwd };\n}\n\n/** Decide pass/fail/timeout, preferring the sentinel over the exit code. */\nfunction decideVerdict(spec: CaseSpec, result: SubprocOutcome, timeoutMs: number): Verdict {\n if (result.timedOut) return { outcome: \"timeout\", message: `timed out after ${timeoutMs}ms` };\n const sentinel = spec.exec.kind === \"module\" ? parseSentinel(result.stdout) : null;\n const pass = sentinel ? sentinel.pass : result.exitCode === 0;\n if (pass) return { outcome: \"pass\" };\n return { outcome: \"fail\", message: sentinel?.message ?? `exit code ${result.exitCode}` };\n}\n\nasync function runOneCase(\n spec: CaseSpec,\n tier: Tier,\n options: EngineOptions,\n worker: string\n): Promise<CaseReport> {\n const label = caseLabel(spec);\n const log = options.log ?? ((m: string) => console.log(m));\n\n const unmet = await firstUnmetNeed(spec.needs);\n if (unmet && !options.strictNeeds) {\n log(` ⊘ ${label} — skipped (needs ${unmet})`);\n return {\n tier: tier.name,\n id: spec.id,\n label,\n outcome: \"skip\",\n durationMs: 0,\n skipReason: `needs ${unmet}`,\n };\n }\n\n const timeoutMs = spec.timeoutMs ?? tier.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n const caseEnv = spec.exec.kind === \"command\" ? spec.exec.env : undefined;\n const env: Record<string, string | undefined> = {\n ...process.env,\n ...options.env,\n ...caseEnv,\n };\n const { argv, cwd } = buildInvocation(spec, worker, options);\n\n const started = performance.now();\n const prefix = ` [${spec.id}] `;\n const result = await runSubprocess(argv, { cwd, env, timeoutMs }, (line) => {\n if (!line.includes(SENTINEL) && line.trim()) log(prefix + line);\n });\n const durationMs = Math.round(performance.now() - started);\n\n const verdict = decideVerdict(spec, result, timeoutMs);\n // A case that finishes just under its cap is a run away from failing on\n // machine load rather than on the thing it tests, so say how close it came\n // (polly#175). A timeout already reports its own budget in the message.\n const budgetNote =\n verdict.outcome === \"timeout\" ? undefined : formatBudgetUse(durationMs, timeoutMs);\n const tail = verdict.message ? ` — ${verdict.message}` : budgetNote ? ` — ${budgetNote}` : \"\";\n log(` ${VERDICT_ICON[verdict.outcome]} ${label} (${durationMs}ms)${tail}`);\n return {\n tier: tier.name,\n id: spec.id,\n label,\n outcome: verdict.outcome,\n durationMs,\n timeoutMs,\n message: verdict.message,\n };\n}\n\nasync function runTier(tier: Tier, options: EngineOptions, worker: string): Promise<CaseReport[]> {\n const log = options.log ?? ((m: string) => console.log(m));\n const matched = tier.cases.filter((c) => caseMatches(c, options.only));\n if (matched.length === 0) return [];\n const selected = orderCases(matched, options.order ?? \"default\");\n\n log(\n `\\n▶ ${tier.name}${tier.description ? ` — ${tier.description}` : \"\"} (${selected.length} case${selected.length === 1 ? \"\" : \"s\"})`\n );\n\n const concurrency = Math.max(1, tier.concurrency ?? 1);\n const failFast = options.failFast ?? false;\n // Slots left empty when soft-fail-fast aborts before claiming them; filtered out below.\n const reports: (CaseReport | undefined)[] = new Array(selected.length);\n let next = 0;\n let aborted = false;\n async function worker_loop(): Promise<void> {\n while (!aborted) {\n const i = next++;\n const spec = selected[i];\n if (!spec) return;\n const report = await runOneCase(spec, tier, options, worker);\n reports[i] = report;\n if (failFast && (report.outcome === \"fail\" || report.outcome === \"timeout\")) {\n aborted = true; // soft: in-flight siblings finish, but no new case is claimed\n }\n }\n }\n await Promise.all(Array.from({ length: Math.min(concurrency, selected.length) }, worker_loop));\n const done = reports.filter((r): r is CaseReport => r !== undefined);\n if (aborted && done.length < selected.length) {\n log(\n ` ⏹ fail-fast: stopped after a failure — ${selected.length - done.length} case(s) not run`\n );\n }\n return done;\n}\n\n/** Run a plan and return a structured report. Does not exit the process. */\nexport async function runPlan(plan: TierPlan, options: EngineOptions = {}): Promise<RunReport> {\n const log = options.log ?? ((m: string) => console.log(m));\n const worker = await workerPath();\n const wanted = options.tiers && options.tiers.length > 0 ? new Set(options.tiers) : null;\n\n const started = performance.now();\n const stopOnFail = Boolean(options.bail || options.failFast);\n const all: CaseReport[] = [];\n for (const tier of plan.tiers) {\n if (wanted && !wanted.has(tier.name)) continue;\n const reports = await runTier(tier, options, worker);\n all.push(...reports);\n if (stopOnFail && reports.some((r) => r.outcome === \"fail\" || r.outcome === \"timeout\")) {\n log(\n `\\n⏹ ${options.failFast ? \"fail-fast\" : \"bail\"}: stopping after failing tier \"${tier.name}\"`\n );\n break;\n }\n }\n\n const durationMs = Math.round(performance.now() - started);\n const passed = all.filter((r) => r.outcome === \"pass\").length;\n const failed = all.filter((r) => r.outcome === \"fail\" || r.outcome === \"timeout\").length;\n const skipped = all.filter((r) => r.outcome === \"skip\").length;\n return { cases: all, passed, failed, skipped, durationMs, ok: failed === 0 };\n}\n",
|
|
13
|
+
"/**\n * Reporting for engine runs: a human summary table (with per-case timing and a\n * slowest-N list, the data the old `&&` chains never captured) and a JSON\n * artefact for tooling. No cloud reporters — everything lands on disk locally.\n */\nimport { formatBudgetUse } from \"./budget\";\nimport type { RunReport, TierPlan } from \"./types\";\n\nconst ICON = { pass: \"✓\", fail: \"✗\", skip: \"⊘\", timeout: \"⏱\" } as const;\n\n/** What follows the timing: the skip reason, the failure, or — for a case\n * that ran clean but close to its cap — how much budget it used (polly#175). */\nfunction caseTail(c: RunReport[\"cases\"][number]): string {\n if (c.outcome === \"skip\") return ` (${c.skipReason})`;\n if (c.message) return ` — ${c.message}`;\n if (c.outcome === \"timeout\") return \"\";\n const budgetNote = formatBudgetUse(c.durationMs, c.timeoutMs);\n return budgetNote ? ` — ${budgetNote}` : \"\";\n}\n\n/** One-line-per-case summary plus totals and slowest cases. */\nexport function formatSummary(report: RunReport): string {\n const lines: string[] = [];\n lines.push(\"\");\n lines.push(\"── results ─────────────────────────────────\");\n for (const c of report.cases) {\n const time = c.outcome === \"skip\" ? \"\" : `${c.durationMs}ms`;\n lines.push(`${ICON[c.outcome]} ${c.tier} › ${c.label} ${time}${caseTail(c)}`);\n }\n\n const ran = report.cases.filter((c) => c.outcome !== \"skip\");\n const slowest = [...ran].sort((a, b) => b.durationMs - a.durationMs).slice(0, 5);\n if (slowest.length > 0) {\n lines.push(\"\");\n lines.push(\"slowest:\");\n for (const c of slowest) lines.push(` ${c.durationMs}ms ${c.tier} › ${c.label}`);\n }\n\n lines.push(\"\");\n lines.push(\n `${report.ok ? \"PASS\" : \"FAIL\"} ${report.passed} passed, ${report.failed} failed, ` +\n `${report.skipped} skipped in ${(report.durationMs / 1000).toFixed(1)}s`\n );\n return lines.join(\"\\n\");\n}\n\n/** Stable JSON artefact written to test-results/. */\nexport function toJSON(report: RunReport): string {\n return JSON.stringify(report, null, 2);\n}\n\n/** `--list` output: tiers and their cases without running anything. */\nexport function formatPlan(plan: TierPlan): string {\n const lines: string[] = [\"Tiers (run order):\", \"\"];\n for (const tier of plan.tiers) {\n const conc = tier.concurrency && tier.concurrency > 1 ? ` ×${tier.concurrency}` : \"\";\n lines.push(`${tier.name}${conc}${tier.description ? ` — ${tier.description}` : \"\"}`);\n for (const c of tier.cases) {\n const needs = c.needs && c.needs.length > 0 ? ` (needs ${c.needs.join(\", \")})` : \"\";\n const cost = c.cost ? ` [${c.cost}]` : \"\";\n lines.push(` ${c.id}${cost}${needs}`);\n }\n lines.push(\"\");\n }\n return lines.join(\"\\n\");\n}\n"
|
|
13
14
|
],
|
|
14
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAmBA;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AClB,KAAK;AAAA,IACL,KAAK,CAAC,MAAM,QAAQ,IAAI,CAAC;AAAA,EAC3B,CAAC;AAAA,EAED,QAAQ,IAAI,cAAc,MAAM,CAAC;AAAA,EAEjC,IAAI,KAAK,MAAM;AAAA,IACb,UAAU,SAAQ,KAAK,IAAI,GAAG,EAAE,WAAW,KAAK,CAAC;AAAA,IACjD,MAAM,IAAI,MAAM,KAAK,MAAM,OAAO,MAAM,CAAC;AAAA,IACzC,QAAQ,IAAI;AAAA,QAAW,KAAK,MAAM;AAAA,EACpC;AAAA,EAEA,QAAQ,KAAK,OAAO,KAAK,IAAI,CAAC;AAAA;AAGhC,MAAM,KAAK;",
|
|
16
|
+
"debugId": "9BB1BCCFB0C4321964756E2164756E21",
|
|
16
17
|
"names": []
|
|
17
18
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* `polly test` command are both front-ends over this.
|
|
8
8
|
*/
|
|
9
9
|
export { DEFAULT_JSON, parseTierArgs, type TierArgs } from "./args";
|
|
10
|
+
export { BUDGET_WARN_FRACTION, budgetUse, formatBudgetUse } from "./budget";
|
|
10
11
|
export { firstUnmetNeed, hasNeed } from "./detect";
|
|
11
12
|
export { discoverPlan } from "./discover";
|
|
12
13
|
export { runPlan } from "./engine";
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reporting for engine runs: a human summary table (with per-case timing and a
|
|
3
|
-
* slowest-N list, the data the old `&&` chains never captured) and a JSON
|
|
4
|
-
* artefact for tooling. No cloud reporters — everything lands on disk locally.
|
|
5
|
-
*/
|
|
6
1
|
import type { RunReport, TierPlan } from "./types";
|
|
7
2
|
/** One-line-per-case summary plus totals and slowest cases. */
|
|
8
3
|
export declare function formatSummary(report: RunReport): string;
|
|
@@ -26,6 +26,12 @@ export type CaseExec = {
|
|
|
26
26
|
kind: "command";
|
|
27
27
|
argv: string[];
|
|
28
28
|
cwd?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Extra environment for this case only, merged over the run-level `env`.
|
|
31
|
+
* Lets one case opt out of what a sibling needs — e.g. SKIP_DOCKER=1 to
|
|
32
|
+
* keep a fast tier off the daemon while a heavy tier drives it.
|
|
33
|
+
*/
|
|
34
|
+
env?: Record<string, string | undefined>;
|
|
29
35
|
};
|
|
30
36
|
/** One runnable unit within a tier. */
|
|
31
37
|
export interface CaseSpec {
|
|
@@ -70,6 +76,9 @@ export interface CaseReport {
|
|
|
70
76
|
label: string;
|
|
71
77
|
outcome: CaseOutcome;
|
|
72
78
|
durationMs: number;
|
|
79
|
+
/** The timeout the case ran under. Carried so the JSON artefact shows the
|
|
80
|
+
* margin a case left against its budget, not just how long it took. */
|
|
81
|
+
timeoutMs?: number;
|
|
73
82
|
message?: string;
|
|
74
83
|
/** Reason a case was skipped (unmet need). */
|
|
75
84
|
skipReason?: string;
|
|
@@ -38,6 +38,24 @@ cd tools/verify/specs/tla
|
|
|
38
38
|
tlc MessageRouter.tla -config MessageRouter.cfg
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
**Cost.** `MessageRouter.cfg` declares `MaxMessages = 4` over three contexts and
|
|
42
|
+
three tabs, and `SendMessage` quantifies over every non-empty subset of
|
|
43
|
+
contexts, so the model runs to over a million distinct states and takes minutes.
|
|
44
|
+
To check the properties quickly, drop the constants:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
CONSTANTS
|
|
48
|
+
Contexts = {background, popup}
|
|
49
|
+
MaxMessages = 1
|
|
50
|
+
Tabs = {0}
|
|
51
|
+
TimeoutLimit = 2
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
That completes in under a second (308 distinct states) and still exercises both
|
|
55
|
+
temporal properties. Removing the `\A i \in 1..MaxMessages : WF_vars(RouteMessage(i))`
|
|
56
|
+
conjunct from `Spec` makes TLC report a violation, so the fairness is
|
|
57
|
+
load-bearing rather than decorative (polly#172).
|
|
58
|
+
|
|
41
59
|
## See Also
|
|
42
60
|
- [Verify Package Documentation](../README.md)
|
|
43
61
|
- [TLA+ Specifications](./tla/README.md)
|
|
@@ -170,6 +170,13 @@ Next ==
|
|
|
170
170
|
|
|
171
171
|
Spec == Init /\ [][Next]_vars /\ WF_vars(Next)
|
|
172
172
|
|
|
173
|
+
(* State constraint. Named rather than inline because TLC's CONSTRAINT clause
|
|
174
|
+
takes a defined operator; an inline expression is rejected with "The
|
|
175
|
+
constraint of Len is equal to <Java Method ...>" before exploration begins,
|
|
176
|
+
so the checked-in .cfg could not be run at all (polly#172). *)
|
|
177
|
+
BoundedOps == Len(messages) <= MaxOps * 4
|
|
178
|
+
|
|
179
|
+
|
|
173
180
|
-----------------------------------------------------------------------------
|
|
174
181
|
|
|
175
182
|
(* Invariants *)
|
|
@@ -19,6 +19,8 @@ PROPERTIES
|
|
|
19
19
|
EventualResolution
|
|
20
20
|
ConnectedEventuallyDelivers
|
|
21
21
|
|
|
22
|
-
\* State constraint (keep state space manageable)
|
|
22
|
+
\* State constraint (keep state space manageable).
|
|
23
|
+
\* polly#172: TLC's CONSTRAINT clause takes a defined operator, not an inline
|
|
24
|
+
\* expression — an inline one stops the run before it reaches the properties.
|
|
23
25
|
CONSTRAINT
|
|
24
|
-
|
|
26
|
+
BoundedMessages
|
|
@@ -172,7 +172,16 @@ Next ==
|
|
|
172
172
|
\/ CompleteRouting
|
|
173
173
|
\/ \E i \in 1..Len(messages) : TimeoutMessage(i)
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
(* polly#172: WF_vars(Next) alone asks only that SOME step happen, which a port
|
|
176
|
+
connecting and disconnecting for ever satisfies while a message sits pending.
|
|
177
|
+
The temporal properties below need per-message routing fairness to be
|
|
178
|
+
checkable, and the range must be the CONSTANT 1..MaxMessages — TLC refuses a
|
|
179
|
+
temporal formula whose quantifier ranges over a VARIABLE. *)
|
|
180
|
+
Spec ==
|
|
181
|
+
/\ Init
|
|
182
|
+
/\ [][Next]_vars
|
|
183
|
+
/\ WF_vars(Next)
|
|
184
|
+
/\ \A i \in 1..MaxMessages : WF_vars(RouteMessage(i))
|
|
176
185
|
|
|
177
186
|
-----------------------------------------------------------------------------
|
|
178
187
|
|
|
@@ -214,19 +223,45 @@ TypeOK ==
|
|
|
214
223
|
|
|
215
224
|
-----------------------------------------------------------------------------
|
|
216
225
|
|
|
226
|
+
(* State constraint. Named rather than inline because TLC's CONSTRAINT clause
|
|
227
|
+
takes a defined operator (polly#172). *)
|
|
228
|
+
BoundedMessages == Len(messages) <= MaxMessages
|
|
229
|
+
|
|
230
|
+
-----------------------------------------------------------------------------
|
|
231
|
+
|
|
217
232
|
(* Temporal properties *)
|
|
218
233
|
|
|
234
|
+
(* polly#172: both properties are quantified over the CONSTANT 1..MaxMessages.
|
|
235
|
+
Written as 1..Len(messages) they ranged over a VARIABLE, and TLC refuses that
|
|
236
|
+
with "In evaluation, the identifier messages is either undefined or not an
|
|
237
|
+
operator" — so neither had ever been checkable. Each side is guarded with
|
|
238
|
+
Len(messages) >= i because TLC evaluates the property in states reached
|
|
239
|
+
before message i exists. *)
|
|
240
|
+
|
|
219
241
|
(* Eventually, all messages resolve (deliver, fail, or timeout) *)
|
|
220
242
|
EventualResolution ==
|
|
221
|
-
\A i \in 1..
|
|
222
|
-
messages[i].status = "pending"
|
|
223
|
-
~> messages
|
|
224
|
-
|
|
225
|
-
|
|
243
|
+
\A i \in 1..MaxMessages :
|
|
244
|
+
(Len(messages) >= i /\ messages[i].status = "pending")
|
|
245
|
+
~> (Len(messages) >= i
|
|
246
|
+
/\ messages[i].status \in {"delivered", "failed", "timeout"})
|
|
247
|
+
|
|
248
|
+
(* A pending message whose targets are all connected is eventually delivered --
|
|
249
|
+
UNLESS one of those targets stops being connected first, in which case
|
|
250
|
+
RouteMessage takes its ELSE arm and the message fails.
|
|
251
|
+
|
|
252
|
+
polly#172: as originally written this demanded delivery outright, and TLC
|
|
253
|
+
finds a two-step counter-example: the target disconnects between the send and
|
|
254
|
+
the route. The property had never been run, so that was never seen. The
|
|
255
|
+
disjunct below is what is actually true, and it still has teeth -- it forbids
|
|
256
|
+
a message sitting pending for ever while its ports stay up, which is the
|
|
257
|
+
routing wedge polly#171 is about. *)
|
|
226
258
|
ConnectedEventuallyDelivers ==
|
|
227
|
-
\A i \in 1..
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
259
|
+
\A i \in 1..MaxMessages :
|
|
260
|
+
(/\ Len(messages) >= i
|
|
261
|
+
/\ messages[i].status = "pending"
|
|
262
|
+
/\ \A target \in messages[i].targets : ports[target] = "connected")
|
|
263
|
+
~> (/\ Len(messages) >= i
|
|
264
|
+
/\ \/ messages[i].status = "delivered"
|
|
265
|
+
\/ \E target \in messages[i].targets : ports[target] # "connected")
|
|
231
266
|
|
|
232
267
|
=============================================================================
|
|
@@ -165,6 +165,13 @@ Next ==
|
|
|
165
165
|
|
|
166
166
|
Spec == Init /\ [][Next]_vars /\ WF_vars(Next)
|
|
167
167
|
|
|
168
|
+
(* State constraint. Named rather than inline because TLC's CONSTRAINT clause
|
|
169
|
+
takes a defined operator; an inline expression is rejected with "The
|
|
170
|
+
constraint of Len is equal to <Java Method ...>" before exploration begins,
|
|
171
|
+
so the checked-in .cfg could not be run at all (polly#172). *)
|
|
172
|
+
BoundedOps == Len(messages) <= MaxOps * 4
|
|
173
|
+
|
|
174
|
+
|
|
168
175
|
-----------------------------------------------------------------------------
|
|
169
176
|
|
|
170
177
|
(* Invariants *)
|
|
@@ -84,7 +84,7 @@ bun run tla:down # Stop container
|
|
|
84
84
|
docker-compose -f specs/docker-compose.yml up -d
|
|
85
85
|
|
|
86
86
|
# Run the model checker against each spec
|
|
87
|
-
docker-compose -f specs/docker-compose.yml exec tla tlc MessageRouter.tla
|
|
87
|
+
docker-compose -f specs/docker-compose.yml exec tla tlc MessageRouter.tla -config MessageRouter.cfg
|
|
88
88
|
docker-compose -f specs/docker-compose.yml exec tla tlc PeerState.tla
|
|
89
89
|
docker-compose -f specs/docker-compose.yml exec tla tlc MeshState.tla
|
|
90
90
|
|