From 3b2d3f42511dcd75e6e2ebe11b23341479926cd2 Mon Sep 17 00:00:00 2001 From: midzer Date: Thu, 30 Aug 2018 00:16:11 +0200 Subject: [PATCH 1/3] call clearDataForOrigin on teardown --- lighthouse-core/gather/gather-runner.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lighthouse-core/gather/gather-runner.js b/lighthouse-core/gather/gather-runner.js index 2967a1b12d5a..34eb05105eef 100644 --- a/lighthouse-core/gather/gather-runner.js +++ b/lighthouse-core/gather/gather-runner.js @@ -54,8 +54,9 @@ const Driver = require('../gather/driver.js'); // eslint-disable-line no-unused- * ii. all gatherers' afterPass() * * 3. Teardown - * A. GatherRunner.disposeDriver() - * B. collect all artifacts and return them + * A. clearDataForOrigin + * B. GatherRunner.disposeDriver() + * C. collect all artifacts and return them * i. collectArtifacts() from completed passes on each gatherer * ii. add trace data and computed artifact methods */ @@ -444,6 +445,7 @@ class GatherRunner { firstPass = false; } } + await driver.clearDataForOrigin(options.requestedUrl); await GatherRunner.disposeDriver(driver); return GatherRunner.collectArtifacts(gathererResults, baseArtifacts); } catch (err) { From 71506ac4d66abca92901b5854c7aa01255317c66 Mon Sep 17 00:00:00 2001 From: midzer Date: Thu, 30 Aug 2018 23:38:00 +0200 Subject: [PATCH 2/3] conditional clearDataForOrigin call --- lighthouse-core/gather/gather-runner.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lighthouse-core/gather/gather-runner.js b/lighthouse-core/gather/gather-runner.js index 34eb05105eef..c247cd329df4 100644 --- a/lighthouse-core/gather/gather-runner.js +++ b/lighthouse-core/gather/gather-runner.js @@ -445,6 +445,8 @@ class GatherRunner { firstPass = false; } } + const resetStorage = !options.settings.disableStorageReset; + if (resetStorage) await driver.clearDataForOrigin(options.requestedUrl); await driver.clearDataForOrigin(options.requestedUrl); await GatherRunner.disposeDriver(driver); return GatherRunner.collectArtifacts(gathererResults, baseArtifacts); From 609477d5b54de33ca626c0cee32a34f1d0e42a73 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 30 Aug 2018 15:21:46 -0700 Subject: [PATCH 3/3] doublemint gum --- lighthouse-core/gather/gather-runner.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lighthouse-core/gather/gather-runner.js b/lighthouse-core/gather/gather-runner.js index c247cd329df4..e4d77795fd16 100644 --- a/lighthouse-core/gather/gather-runner.js +++ b/lighthouse-core/gather/gather-runner.js @@ -447,7 +447,6 @@ class GatherRunner { } const resetStorage = !options.settings.disableStorageReset; if (resetStorage) await driver.clearDataForOrigin(options.requestedUrl); - await driver.clearDataForOrigin(options.requestedUrl); await GatherRunner.disposeDriver(driver); return GatherRunner.collectArtifacts(gathererResults, baseArtifacts); } catch (err) {