Skip to content

Commit

Permalink
core(gather-runner): call clearDataForOrigin on teardown (#5933)
Browse files Browse the repository at this point in the history
  • Loading branch information
midzer authored and paulirish committed Sep 5, 2018
1 parent e07a94b commit adc0275
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lighthouse-core/gather/gather-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -444,6 +445,8 @@ class GatherRunner {
firstPass = false;
}
}
const resetStorage = !options.settings.disableStorageReset;
if (resetStorage) await driver.clearDataForOrigin(options.requestedUrl);
await GatherRunner.disposeDriver(driver);
return GatherRunner.collectArtifacts(gathererResults, baseArtifacts);
} catch (err) {
Expand Down

0 comments on commit adc0275

Please sign in to comment.