diff options
-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); } |