diff --git a/scripts/src/provider-apps-linux.ts b/scripts/src/provider-apps-linux.ts index 7587c476..b2bc9680 100644 --- a/scripts/src/provider-apps-linux.ts +++ b/scripts/src/provider-apps-linux.ts @@ -66,6 +66,10 @@ function checked(result: CommandResult, operation: string): CommandResult { return result; } +function transferFailureDetail(result: CommandResult): string { + return [result.stdout.trim(), result.stderr.trim()].filter((value) => value.length > 0).join("\n"); +} + function trans(route: string, operation: string[], timeoutMs = 60_000): CommandResult { return runCommand([transPath, route, ...operation], repositoryRoot, { timeoutMs }); } @@ -257,11 +261,11 @@ async function benchmark(id: string, target: LinuxInstallTarget, args: string[]) remoteFiles.add(remote); process.stderr.write(`${JSON.stringify({ event: "provider-apps.linux.benchmark.stage", stage: "upload", round, bytes: spec.transferBytes })}\n`); const upload = await transAsync(id, ["upload", payload, remote, "--runtime-timeout-ms", "600000"], 600_000, true); - if (upload.exitCode !== 0) throw new Error(`upload failed round=${round}: ${upload.stderr}`); + if (upload.exitCode !== 0) throw new Error(`upload failed round=${round}: ${transferFailureDetail(upload)}`); const localCopy = join(local, `download-${round}.bin`); process.stderr.write(`${JSON.stringify({ event: "provider-apps.linux.benchmark.stage", stage: "download", round, bytes: spec.transferBytes })}\n`); const download = await transAsync(id, ["download", remote, localCopy, "--runtime-timeout-ms", "600000"], 600_000, true); - if (download.exitCode !== 0) throw new Error(`download failed round=${round}: ${download.stderr}`); + if (download.exitCode !== 0) throw new Error(`download failed round=${round}: ${transferFailureDetail(download)}`); const sha = fileSha256(localCopy); if (sha !== payloadSha) throw new Error(`download SHA mismatch round=${round}`); rmSync(localCopy, { force: true }); diff --git a/scripts/src/remote-ssh.ts b/scripts/src/remote-ssh.ts index 272f62aa..a44a776d 100644 --- a/scripts/src/remote-ssh.ts +++ b/scripts/src/remote-ssh.ts @@ -925,7 +925,7 @@ async function runRemoteSshOverFrontend(session: FrontendSession, target: string if (isSshFileTransferOperation(normalizedArgs)) { const executor: SshRemoteCommandExecutor = { streamInactivityTimeoutMs: sshRuntimeTimeoutMs(), - runRemoteCommand: (remoteCommand, input) => runRemoteSshWebSocketCaptureRemoteCommand(session, invocation, remoteCommand, input), + runRemoteCommand: (remoteCommand, input, options) => runRemoteSshWebSocketCaptureRemoteCommand(session, invocation, remoteCommand, input, options), streamRemoteCommand: (remoteCommand, handlers, input, options) => runRemoteSshWebSocketStreamRemoteCommand(session, invocation, remoteCommand, handlers, input, options), }; return await runSshFileTransferOperation(invocation, normalizedArgs, executor, {