Revert "[flutter] Speed-up `linux_web_engine_test` LUCI build by loading caches in parallel" This reverts commit 260bcbba69c1d9eec2417de1c273b6f26a95bc6f. Reason for revert: `Linux linux_web_engine_tests` jobs start failing after this change. https://luci-milo.appspot.com/ui/p/flutter/builders/try/Linux%20linux_web_engine_tests/14912/overview ... https://luci-milo.appspot.com/ui/p/flutter/builders/try/Linux%20linux_web_engine_tests/14919/overview Failure Link: <LINK TO FAILURE> Original change's description: > [flutter] Speed-up `linux_web_engine_test` LUCI build by loading caches in parallel > > Google-Bug-Id: 520537519 > Change-Id: Ib894795951b556052568e2268042ad72ea002faa > Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/79500 > Reviewed-by: John McDole <codefu@google.com> > Commit-Queue: Dmitry Grand <dmgr@google.com> TBR=flutter-scoped@luci-project-accounts.iam.gserviceaccount.com,jacksongardner@google.com,codefu@google.com,dmgr@google.com No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: I2017f82e648c5ff5bde79c93de7224b1e763df30 Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/79540 Commit-Queue: Dmitry Grand <dmgr@google.com> Reviewed-by: Dmitry Grand <dmgr@google.com> Reviewed-by: John McDole <codefu@google.com>
diff --git a/recipe_modules/cache/__init__.py b/recipe_modules/cache/__init__.py index ad00b8d..d8b35e9 100644 --- a/recipe_modules/cache/__init__.py +++ b/recipe_modules/cache/__init__.py
@@ -7,11 +7,9 @@ 'depot_tools/gsutil', 'recipe_engine/cas', 'recipe_engine/file', - 'recipe_engine/futures', 'recipe_engine/json', 'recipe_engine/platform', 'recipe_engine/step', 'recipe_engine/raw_io', 'recipe_engine/path', ] -
diff --git a/recipe_modules/cache/api.py b/recipe_modules/cache/api.py index c5577a0..7168948 100644 --- a/recipe_modules/cache/api.py +++ b/recipe_modules/cache/api.py
@@ -111,24 +111,14 @@ ).stdout if self._test_data.enabled: metadata = metadata or collections.defaultdict(dict) - futures = [] for k, v in metadata['hashes'].items(): if force: self.m.file.rmtree('Clobber local cache: %s' % k, cache_root / k) # Mount the cache only if it doesn't exist locally. if not self.m.path.exists(cache_root / k): - futures.append( - self.m.futures.spawn( - self.m.cas.download, - 'Mounting %s with hash %s' % (k, v), - v, - cache_root / k, - ) + self.m.cas.download( + 'Mounting %s with hash %s' % (k, v), v, cache_root / k ) - if futures: - self.m.futures.wait(futures) - for future in futures: - future.result() def should_force_mount(self, mount_path): """Determines if a cache should be force mounted.
diff --git a/recipe_modules/cache/tests/refresh.expected/basic.json b/recipe_modules/cache/tests/refresh.expected/basic.json index 5ee97b1..9b49ce3 100644 --- a/recipe_modules/cache/tests/refresh.expected/basic.json +++ b/recipe_modules/cache/tests/refresh.expected/basic.json
@@ -219,22 +219,6 @@ }, { "cmd": [ - "vpython3", - "-u", - "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", - "--json-output", - "/path/to/tmp/json", - "rmtree", - "[CACHE]/git" - ], - "infra_step": true, - "name": "Mount caches.Clobber local cache: git", - "~followup_annotations": [ - "@@@STEP_NEST_LEVEL@1@@@" - ] - }, - { - "cmd": [ "[START_DIR]/cipd_tool/infra/tools/luci/cas/33f9d887e5b8aeaaf9d65506acccfa8da2c480712e534a23a79e92c342c44bee/cas", "download", "-cas-instance", @@ -252,6 +236,22 @@ }, { "cmd": [ + "vpython3", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "rmtree", + "[CACHE]/git" + ], + "infra_step": true, + "name": "Mount caches.Clobber local cache: git", + "~followup_annotations": [ + "@@@STEP_NEST_LEVEL@1@@@" + ] + }, + { + "cmd": [ "[START_DIR]/cipd_tool/infra/tools/luci/cas/33f9d887e5b8aeaaf9d65506acccfa8da2c480712e534a23a79e92c342c44bee/cas", "download", "-cas-instance",
diff --git a/recipe_modules/cache/tests/refresh.expected/no_cache_file.json b/recipe_modules/cache/tests/refresh.expected/no_cache_file.json index 5f3b4ba..bfed5d0 100644 --- a/recipe_modules/cache/tests/refresh.expected/no_cache_file.json +++ b/recipe_modules/cache/tests/refresh.expected/no_cache_file.json
@@ -201,22 +201,6 @@ }, { "cmd": [ - "vpython3", - "-u", - "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", - "--json-output", - "/path/to/tmp/json", - "rmtree", - "[CACHE]/git" - ], - "infra_step": true, - "name": "Mount caches.Clobber local cache: git", - "~followup_annotations": [ - "@@@STEP_NEST_LEVEL@1@@@" - ] - }, - { - "cmd": [ "[START_DIR]/cipd_tool/infra/tools/luci/cas/33f9d887e5b8aeaaf9d65506acccfa8da2c480712e534a23a79e92c342c44bee/cas", "download", "-cas-instance", @@ -234,6 +218,22 @@ }, { "cmd": [ + "vpython3", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "rmtree", + "[CACHE]/git" + ], + "infra_step": true, + "name": "Mount caches.Clobber local cache: git", + "~followup_annotations": [ + "@@@STEP_NEST_LEVEL@1@@@" + ] + }, + { + "cmd": [ "[START_DIR]/cipd_tool/infra/tools/luci/cas/33f9d887e5b8aeaaf9d65506acccfa8da2c480712e534a23a79e92c342c44bee/cas", "download", "-cas-instance",