mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 21:46:48 +00:00

PR-URL: https://github.com/nodejs/node/pull/35086 Reviewed-By: Ruy Adorno <ruyadorno@github.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
21 lines
559 B
JavaScript
21 lines
559 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const { Worker, isMainThread } = require('worker_threads');
|
|
|
|
// Regression test for https://github.com/nodejs/node/issues/28144.
|
|
|
|
if (isMainThread) {
|
|
const w = new Worker(__filename);
|
|
w.on('exit', common.mustCall((status) => {
|
|
assert.strictEqual(status, 0);
|
|
}));
|
|
w.stdout.on('data', common.mustCall(10));
|
|
} else {
|
|
process.stdin.on('data', () => {});
|
|
|
|
for (let i = 0; i < 10; ++i) {
|
|
process.stdout.write(`processing(${i})\n`, common.mustSucceed());
|
|
}
|
|
}
|