test: only suppress starttask.sh output and not sudo
the remote support logic uses sudo output in tests
This commit is contained in:
+5
-1
@@ -45,8 +45,10 @@ exports = module.exports = {
|
||||
|
||||
const assert = require('assert'),
|
||||
BoxError = require('./boxerror.js'),
|
||||
constants = require('./constants.js'),
|
||||
database = require('./database.js'),
|
||||
debug = require('debug')('box:tasks'),
|
||||
fs = require('fs'),
|
||||
logs = require('./logs.js'),
|
||||
path = require('path'),
|
||||
paths = require('./paths.js'),
|
||||
@@ -167,7 +169,9 @@ function startTask(id, options, callback) {
|
||||
|
||||
let killTimerId = null, timedOut = false;
|
||||
|
||||
gTasks[id] = shell.sudo('startTask', [ START_TASK_CMD, id, logFile, options.nice || 0, options.memoryLimit || 400 ], { preserveEnv: true }, async function (sudoError) {
|
||||
const sudoOptions = { preserveEnv: true, logStream: null };
|
||||
if (constants.TEST) sudoOptions.logStream = fs.createWriteStream('/dev/null'); // without this output is messed up, not sure why
|
||||
gTasks[id] = shell.sudo('startTask', [ START_TASK_CMD, id, logFile, options.nice || 0, options.memoryLimit || 400 ], sudoOptions, async function (sudoError) {
|
||||
if (!gTasks[id]) return; // ignore task exit since we are shutting down. see stopAllTasks
|
||||
|
||||
const code = sudoError ? sudoError.code : 0;
|
||||
|
||||
Reference in New Issue
Block a user