This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

25
node_modules/piscina/test/console-log.test.ts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
import assert from 'node:assert/strict';
import { resolve } from 'node:path';
import { spawn } from 'node:child_process';
import { test } from 'node:test';
import concat from 'concat-stream';
test('console.log() calls are not blocked by Atomics.wait() (sync mode)', async () => {
const proc = spawn(process.execPath, [
...process.execArgv, resolve(__dirname, 'fixtures/console-log.ts')
], {
stdio: ['inherit', 'pipe', 'pipe'],
env: {
PISCINA_ENABLE_ASYNC_ATOMICS: '0'
}
});
const dataStdout = await new Promise((resolve) => {
proc.stdout.setEncoding('utf8').pipe(concat(resolve));
});
const dataStderr = await new Promise((resolve) => {
proc.stderr.setEncoding('utf8').pipe(concat(resolve));
});
assert.strictEqual(dataStdout, 'A\n');
assert.strictEqual(dataStderr, 'B\n');
});