mirror of
https://github.com/appium/appium.git
synced 2026-05-08 03:49:30 -05:00
fix NewCommandTimeout handling for freshly created sessions
This commit is contained in:
+9
-3
@@ -16,6 +16,10 @@ import util from 'util';
|
||||
class AppiumDriver extends BaseDriver {
|
||||
constructor (args) {
|
||||
super();
|
||||
|
||||
// the main Appium Driver has no new command timeout
|
||||
this.newCommandTimeoutMs = 0;
|
||||
|
||||
this.args = args;
|
||||
|
||||
this.sessions = {};
|
||||
@@ -110,12 +114,17 @@ class AppiumDriver extends BaseDriver {
|
||||
.catch(B.CancellationError, () => {})
|
||||
.catch((err) => {
|
||||
log.warn(`Closing session, cause was '${err.message}'`);
|
||||
log.info(`Removing session ${innerSessionId} from our master session list`);
|
||||
delete this.sessions[innerSessionId];
|
||||
})
|
||||
.done();
|
||||
|
||||
log.info(`New ${InnerDriver.name} session created successfully, session ` +
|
||||
`${innerSessionId} added to master session list`);
|
||||
|
||||
// set the New Command Timeout for the inner driver
|
||||
d.startNewCommandTimeout();
|
||||
|
||||
return [innerSessionId, dCaps];
|
||||
}
|
||||
|
||||
@@ -155,9 +164,6 @@ class AppiumDriver extends BaseDriver {
|
||||
return super.executeCommand(cmd, ...args);
|
||||
}
|
||||
|
||||
// since we don't call super.executeCommand, we need
|
||||
// to clear the appium driver timeout manually
|
||||
this.clearNewCommandTimeout();
|
||||
let sessionId = args[args.length - 1];
|
||||
return this.sessions[sessionId].executeCommand(cmd, ...args);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user