mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 04:18:58 +00:00
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: nektro <nektro@users.noreply.github.com> Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
28 lines
613 B
JavaScript
28 lines
613 B
JavaScript
"use strict";
|
|
const common = require("../common");
|
|
const cluster = require("cluster");
|
|
const assert = require("assert");
|
|
|
|
if (cluster.isPrimary) {
|
|
const worker = cluster.fork();
|
|
|
|
worker.on(
|
|
"online",
|
|
common.mustCall(() => {
|
|
// Use worker.process.kill() instead of worker.kill() because the latter
|
|
// waits for a graceful disconnect, which will never happen.
|
|
worker.process.kill();
|
|
}),
|
|
);
|
|
|
|
worker.on(
|
|
"exit",
|
|
common.mustCall((code, signal) => {
|
|
assert.strictEqual(code, null);
|
|
assert.strictEqual(signal, "SIGTERM");
|
|
}),
|
|
);
|
|
} else {
|
|
while (true);
|
|
}
|