// Auto-generated by scripts/gen_parity_tests.py from docs/runtime-parity.md.
// Module: node:cluster
// This file is a byte-for-byte parity test against `node --experimental-strip-types`.
// Edit the TODO lines below to exercise each API; rerun
// `./run_parity_tests.sh --filter test_parity_cluster` to verify.

import * as cluster from "node:cluster";


// ── Module-Level Properties / Methods ──
console.log("cluster.isPrimary:", cluster.isPrimary);
console.log("cluster.isMaster:", cluster.isMaster);
console.log("cluster.isWorker:", cluster.isWorker);
console.log("cluster.worker:", cluster.worker);
console.log("cluster.workers:", cluster.workers);
console.log("cluster.settings:", cluster.settings);
console.log("cluster.schedulingPolicy:", cluster.schedulingPolicy);
console.log("cluster.SCHED_RR:", cluster.SCHED_RR);
console.log("cluster.SCHED_NONE:", cluster.SCHED_NONE);

// cluster.fork([env]) — type probe only (don't actually fork a child)
try {
  console.log("cluster.fork typeof:", typeof cluster.fork);
} catch (e: any) { console.log("cluster.fork ERR:", e && e.message); }

// cluster.disconnect([callback]) — type probe (no workers to disconnect)
try {
  console.log("cluster.disconnect typeof:", typeof cluster.disconnect);
} catch (e: any) { console.log("cluster.disconnect ERR:", e && e.message); }

// cluster.setupPrimary([settings]) — type probe (avoid mutating global settings)
try {
  console.log("cluster.setupPrimary typeof:", typeof cluster.setupPrimary);
} catch (e: any) { console.log("cluster.setupPrimary ERR:", e && e.message); }

// cluster.setupMaster([settings]) — deprecated alias, type probe only
try {
  console.log("cluster.setupMaster typeof:", typeof cluster.setupMaster);
} catch (e: any) { console.log("cluster.setupMaster ERR:", e && e.message); }

// ── Cluster Module Events ──
// 'fork' / 'online' / 'listening' / 'message' / 'disconnect' / 'exit' / 'setup' — type probe only
try {
  console.log("cluster.on typeof:", typeof cluster.on);
  console.log("cluster.addListener typeof:", typeof cluster.addListener);
} catch (e: any) { console.log("cluster events ERR:", e && e.message); }

// ── Worker Class ──
// On the primary process `cluster.worker` is undefined, so we can only probe types via the class itself.
try {
  console.log("cluster.Worker typeof:", typeof cluster.Worker);
} catch (e: any) { console.log("cluster.Worker ERR:", e && e.message); }
// PERRY-SKIP: worker.id / worker.process / worker.exitedAfterDisconnect / worker.send /
//   worker.disconnect() / worker.kill() / worker.destroy() / worker.isConnected() / worker.isDead()
//   — require an actual forked worker which the "don't fork" rule rules out.

// ── Worker Events ──
// 'error' — type probe only (no worker instance to attach to)
try {
  console.log("Worker 'error' event: probe-only (no fork)");
} catch (e: any) { console.log("Worker 'error' ERR:", e && e.message); }

// Coverage: 9 auto-emitted, 21 TODO, 0 skip-listed.
