Backed out changeset 34faef444ae3 (bug 1403923) for WD failures on Linux debug and x64 debug at /webdriver/tests/execute_async_script/user_prompts.py r=backout on a CLOSED TREE

This commit is contained in:
Cosmin Sabou 2017-12-15 21:02:58 +02:00
parent 22ca1231e8
commit 92439c6859
3 changed files with 8 additions and 48 deletions

View File

@ -14,9 +14,6 @@ Unreleased
- Backtraces from geckodriver no longer substitute for missing
Marionette stacktraces
- `Delete Session` now allows Firefox to safely shutdown within 130s before
force-killing the process
0.19.1 (2017-10-30)
-------------------

View File

@ -57,10 +57,6 @@ use prefs;
const DEFAULT_HOST: &'static str = "localhost";
// Firefox' integrated background monitor which observes long running threads during
// shutdown kills those after 120s. Wait some additional seconds for a safe shutdown
const TIMEOUT_BROWSER_SHUTDOWN: u64 = 130 * 1000;
pub fn extension_routes() -> Vec<(Method, &'static str, GeckoExtensionRoute)> {
return vec![(Method::Get, "/session/{sessionId}/moz/context", GeckoExtensionRoute::GetContext),
(Method::Post, "/session/{sessionId}/moz/context", GeckoExtensionRoute::SetContext),
@ -577,51 +573,18 @@ impl WebDriverHandler<GeckoExtensionRoute> for MarionetteHandler {
}
}
fn delete_session(&mut self, session: &Option<Session>) {
// If there is still an active session send a delete session command
// and wait for the browser to quit
if let Some(ref s) = *session {
let delete_session = WebDriverMessage {
session_id: Some(s.id.clone()),
command: WebDriverCommand::DeleteSession
};
let _ = self.handle_command(session, delete_session);
if let Some(ref mut runner) = self.browser {
let timeout = TIMEOUT_BROWSER_SHUTDOWN;
let poll_interval = 100;
let poll_attempts = timeout / poll_interval;
let mut poll_attempt = 0;
while runner.is_running() {
if poll_attempt <= poll_attempts {
debug!("Waiting for the browser process to shutdown");
poll_attempt += 1;
sleep(Duration::from_millis(poll_interval));
} else {
warn!("Browser process did not shutdown");
break;
}
}
}
}
if let Ok(ref mut connection) = self.connection.lock() {
if let Some(conn) = connection.as_mut() {
fn delete_session(&mut self, _: &Option<Session>) {
if let Ok(connection) = self.connection.lock() {
if let Some(ref conn) = *connection {
conn.close();
}
}
// If the browser is still open then kill the process
if let Some(ref mut runner) = self.browser {
if runner.is_running() {
info!("Forcing a shutdown of the browser process");
if runner.stop().is_err() {
error!("Failed to kill browser process");
};
}
debug!("Stopping browser process");
if runner.stop().is_err() {
error!("Failed to kill browser process");
};
}
self.connection = Mutex::new(None);
self.browser = None;
}

View File

@ -25,7 +25,7 @@ enum DispatchMessage<U: WebDriverExtensionRoute> {
#[derive(Clone, Debug, PartialEq)]
pub struct Session {
pub id: String
id: String
}
impl Session {