Skip to content

Commit

Permalink
chore: set default command timeout (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored May 7, 2024
1 parent d48be0d commit 6623df2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/appium-tizen-tv-driver/lib/cli/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import log from '../logger';
const TIZEN_BIN_NAME = 'tizen';
const SDB_BIN_NAME = 'sdb';

/**
* Default timeout to wait for the tizen command.
*/
const CMD_TIMEOUT_MS = 240000;

/**
* Lookup of path parts by bin name, relative to `TIZEN_HOME` env var
*/
Expand Down Expand Up @@ -36,7 +41,7 @@ async function runCmd(bin, args) {
}
log.info(`Running command: ${bins[bin]} ${args.join(' ')}`);
try {
return await exec(bins[bin], args);
return await exec(bins[bin], args, {timeout: CMD_TIMEOUT_MS});
} catch (err) {
const e = /** @type {import('teen_process').ExecError} */ (err);
const stdout = e.stdout.replace(/[\r\n]+/g, ' ');
Expand Down

0 comments on commit 6623df2

Please sign in to comment.