diff --git a/.circleci/config.yml b/.circleci/config.yml index 61cbe4b16a4..9c6c67f873f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: aws-cli: circleci/aws-cli@1.4.0 - browser-tools: circleci/browser-tools@1.1.1 + browser-tools: circleci/browser-tools@1.2.3 workflows: version: 2 @@ -245,8 +245,7 @@ jobs: steps: - attach_workspace: at: ~/ - - browser-tools/install-chrome: - chrome-version: 91.0.4472.164 + - browser-tools/install-chrome - run: yarn run test-render - store_test_results: path: test/integration/render-tests @@ -258,8 +257,7 @@ jobs: steps: - attach_workspace: at: ~/ - - browser-tools/install-chrome: - chrome-version: 91.0.4472.164 + - browser-tools/install-chrome - run: yarn run test-render-prod - store_test_results: path: test/integration/render-tests @@ -271,8 +269,7 @@ jobs: steps: - attach_workspace: at: ~/ - - browser-tools/install-chrome: - chrome-version: 91.0.4472.164 + - browser-tools/install-chrome - run: yarn run test-query - store_test_results: path: test/integration/query-tests @@ -299,8 +296,7 @@ jobs: steps: - attach_workspace: at: ~/ - - browser-tools/install-chrome: - chrome-version: 91.0.4472.164 + - browser-tools/install-chrome - run: name: Collect performance stats command: node bench/gl-stats.js diff --git a/src/source/worker.js b/src/source/worker.js index b1336bec6bd..621ee02ff49 100644 --- a/src/source/worker.js +++ b/src/source/worker.js @@ -78,6 +78,14 @@ export default class Worker { }; } + clearCaches(mapId: string, unused: mixed, callback: WorkerTileCallback) { + delete this.layerIndexes[mapId]; + delete this.availableImages[mapId]; + delete this.workerSources[mapId]; + delete this.demWorkerSources[mapId]; + callback(); + } + checkIfReady(mapID: string, unused: mixed, callback: WorkerTileCallback) { // noop, used to check if a worker is fully set up and ready to receive messages callback(); diff --git a/src/style/style.js b/src/style/style.js index b9d9035d328..c7c4e9737ef 100644 --- a/src/style/style.js +++ b/src/style/style.js @@ -1765,6 +1765,10 @@ class Style extends Evented { hasCircleLayers(): boolean { return this._numCircleLayers > 0; } + + clearWorkerCaches() { + this.dispatcher.broadcast('clearCaches'); + } } Style.getSourceType = getSourceType; diff --git a/src/ui/map.js b/src/ui/map.js index adea9b40d35..5ba4ba75a15 100755 --- a/src/ui/map.js +++ b/src/ui/map.js @@ -3078,6 +3078,9 @@ class Map extends Camera { } this._renderTaskQueue.clear(); this._domRenderTaskQueue.clear(); + if (this.style) { + this.style.clearWorkerCaches(); + } this.painter.destroy(); this.handlers.destroy(); delete this.handlers; diff --git a/test/integration/lib/query.js b/test/integration/lib/query.js index 29ca4ed9a44..6e8fc86a2ca 100644 --- a/test/integration/lib/query.js +++ b/test/integration/lib/query.js @@ -149,7 +149,7 @@ async function runTest(t) { ]; } - browserWriteFile.postMessage(fileInfo); + if (!process.env.CI) browserWriteFile.postMessage(fileInfo); } catch (e) { t.error(e); diff --git a/test/integration/lib/render.js b/test/integration/lib/render.js index 93902815d3b..623fed8abf7 100644 --- a/test/integration/lib/render.js +++ b/test/integration/lib/render.js @@ -74,6 +74,7 @@ function ensureTeardown(t) { delete map.painter.context.gl; map = null; } + mapboxgl.clearStorage(); expectedCtx.clearRect(0, 0, expectedCanvas.width, expectedCanvas.height); diffCtx.clearRect(0, 0, diffCanvas.width, diffCanvas.height); @@ -308,7 +309,7 @@ async function runTest(t) { updateHTML(testMetaData); } - browserWriteFile.postMessage(fileInfo); + if (!process.env.CI) browserWriteFile.postMessage(fileInfo); } catch (e) { t.error(e);