Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add timeout option for exec #254

Merged
merged 4 commits into from
Aug 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/simctl.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ const DEFAULT_OPTS = {
* command input and outputs.
* @property {string|string[]} [architectures] - One or more architecture names to be enforced while
* executing xcrun. See https://github.com/appium/appium/issues/18966 for more details.
* @property {number} [timeout] - The maximum number of milliseconds
* to wait for single synchronous xcrun command. If not provided explicitly, then
* the value of execTimeout property is used by default.
*/

/**
Expand All @@ -72,7 +75,7 @@ const DEFAULT_OPTS = {
* the instance to automatically detect the full path to `xcrun` tool and to throw
* an exception if it cannot be detected. If the path is set upon instance creation
* then it is going to be used by `exec` and no autodetection will happen.
* @property {number} [execTimeout=600000] - The maximum number of milliseconds
* @property {number} [execTimeout=600000] - The default maximum number of milliseconds
* to wait for single synchronous xcrun command.
* @property {boolean} [logErrors=true] - Whether to wire xcrun error messages
* into debug log before throwing them.
Expand Down Expand Up @@ -175,6 +178,7 @@ class Simctl {
encoding,
logErrors = true,
architectures,
timeout,
} = opts ?? {};
// run a particular simctl command
args = [
Expand All @@ -196,7 +200,7 @@ class Simctl {
encoding,
};
if (!asynchronous) {
execOpts.timeout = this.execTimeout;
execOpts.timeout = timeout || this.execTimeout;
}
const xcrun = await this.requireXcrun();
try {
Expand Down
Loading