gui/ui/node_modules.bak/piscina/test/console-log.test.ts
Snider fad16c8c76
Some checks failed
Security Scan / security (push) Failing after 34s
Test / test (push) Failing after 1m44s
chore: sync workspace dependencies
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 15:44:56 +00:00

25 lines
828 B
TypeScript

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');
});