diff options
author | 2023-03-04 18:32:27 -0800 | |
---|---|---|
committer | 2023-03-04 18:32:27 -0800 | |
commit | adf8bae23cfa2a233ed3a55cb1a04194a9545af2 (patch) | |
tree | c7aba837a529a8716c660254d92ea4ce0d85425f | |
parent | 03997086ea314e277bbe9ddbbef5e6344733a74a (diff) | |
download | bun-adf8bae23cfa2a233ed3a55cb1a04194a9545af2.tar.gz bun-adf8bae23cfa2a233ed3a55cb1a04194a9545af2.tar.zst bun-adf8bae23cfa2a233ed3a55cb1a04194a9545af2.zip |
Update runner.node.mjs
-rw-r--r-- | packages/bun-internal-test/src/runner.node.mjs | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/packages/bun-internal-test/src/runner.node.mjs b/packages/bun-internal-test/src/runner.node.mjs index 4e62b1c72..9f7360839 100644 --- a/packages/bun-internal-test/src/runner.node.mjs +++ b/packages/bun-internal-test/src/runner.node.mjs @@ -1,5 +1,6 @@ import * as action from "@actions/core"; import { spawnSync } from "child_process"; +import { fsyncSync, writeSync } from "fs"; import { readdirSync } from "node:fs"; import { resolve } from "node:path"; import { StringDecoder } from "node:string_decoder"; @@ -22,6 +23,19 @@ function* findTests(dir, query) { } } +function dump(buf) { + var offset = 0, + length = buf.byteLength; + while (offset < length) { + const wrote = writeSync(1, buf); + offset += wrote; + if (offset < length) { + fsyncSync(1); + buf = buf.slice(wrote); + } + } +} + async function runTest(path) { const name = path.replace(cwd, "").slice(1); const { @@ -41,15 +55,15 @@ async function runTest(path) { action.startGroup(`${prefix} - ${name}`); } - process.stdout.write(stdout); + dump(stdout); if (isAction) { findErrors(stdout); - process.stdout.write(stderr); + dump(stderr); findErrors(stderr); } else { - process.stdout.write(stderr); + dump(stderr); findErrors(stderr); } |