mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-12 21:37:41 -06:00
Include stdout in test worker error messages (#35921)
This commit is contained in:
parent
bab0c99584
commit
e50f0aabd2
@ -89,9 +89,9 @@ namespace Harness {
|
||||
Baseline.runBaseline(`${cls.kind()}/${directoryName}.log`, cls.report(cp.spawnSync(`node`, args, { cwd, timeout, shell: true }), cwd));
|
||||
|
||||
function exec(command: string, args: string[], options: { cwd: string, timeout?: number }): void {
|
||||
const res = cp.spawnSync(command, args, { timeout, shell: true, stdio, ...options });
|
||||
const res = cp.spawnSync(isWorker ? `${command} 2>&1` : command, args, { shell: true, stdio, ...options });
|
||||
if (res.status !== 0) {
|
||||
throw new Error(`${command} ${args.join(" ")} for ${directoryName} failed: ${res.stderr && res.stderr.toString()}`);
|
||||
throw new Error(`${command} ${args.join(" ")} for ${directoryName} failed: ${res.stdout && res.stdout.toString()}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -146,12 +146,12 @@ ${stripAbsoluteImportPaths(result.stderr.toString().replace(/\r\n/g, "\n"))}`;
|
||||
}
|
||||
|
||||
private timeout = 1_200_000; // 20 minutes;
|
||||
private exec(command: string, args: string[], options: { cwd: string, timeout?: number }): void {
|
||||
private exec(command: string, args: string[], options: { cwd: string }): void {
|
||||
const cp: typeof import("child_process") = require("child_process");
|
||||
const stdio = isWorker ? "pipe" : "inherit";
|
||||
const res = cp.spawnSync(command, args, { timeout: this.timeout, shell: true, stdio, ...options });
|
||||
const res = cp.spawnSync(isWorker ? `${command} 2>&1` : command, args, { timeout: this.timeout, shell: true, stdio, ...options });
|
||||
if (res.status !== 0) {
|
||||
throw new Error(`${command} ${args.join(" ")} for ${options.cwd} failed: ${res.stderr && res.stderr.toString()}`);
|
||||
throw new Error(`${command} ${args.join(" ")} for ${options.cwd} failed: ${res.stdout && res.stdout.toString()}`);
|
||||
}
|
||||
}
|
||||
report(result: ExecResult) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user