From e332691f20500c208be41fbce5e560c806e1f57b Mon Sep 17 00:00:00 2001 From: Sam Saccone Date: Thu, 25 May 2017 01:16:38 -0700 Subject: [PATCH] Return disconnect promise to prevent race (#2359) --- lighthouse-core/gather/gather-runner.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lighthouse-core/gather/gather-runner.js b/lighthouse-core/gather/gather-runner.js index 5de4e7e78974..2a8b8de0f5ad 100644 --- a/lighthouse-core/gather/gather-runner.js +++ b/lighthouse-core/gather/gather-runner.js @@ -118,10 +118,8 @@ class GatherRunner { } static disposeDriver(driver) { - // We dont need to hold up the reporting for the reload/disconnect, - // so we will not return a promise in here. log.log('status', 'Disconnecting from browser...'); - driver.disconnect().catch(err => { + return driver.disconnect().catch(err => { // Ignore disconnecting error if browser was already closed. // See https://github.com/GoogleChrome/lighthouse/issues/1583 if (!(/close\/.*status: 500$/.test(err.message))) {