report_stages: Use the full GSContextMock.
If a test tries to mock a specific GS function, but doesn't use
GSContextMock, it can block in run_tests while trying (inside a retry
loop) to fetch gsutil.
This can block other tests who also try to fetch gsutil.
BUG=chromium:4822235
TEST=Ran tests in conditions that reproduce the bug.
Change-Id: Ibcf7fe078c979cc189cde3de3912c0ca4fdcc329
Reviewed-on: https://chromium-review.googlesource.com/267786
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
diff --git a/cbuildbot/stages/report_stages_unittest.py b/cbuildbot/stages/report_stages_unittest.py
index 697e2a6..9729559 100644
--- a/cbuildbot/stages/report_stages_unittest.py
+++ b/cbuildbot/stages/report_stages_unittest.py
@@ -26,7 +26,7 @@
from chromite.lib import cidb
from chromite.lib import cros_build_lib
from chromite.lib import fake_cidb
-from chromite.lib import gs
+from chromite.lib import gs_unittest
from chromite.lib import osutils
from chromite.lib import retry_stats
from chromite.lib import toolchain
@@ -49,7 +49,8 @@
release_tag = '4815.0.0-rc1'
self._run.attrs.release_tag = '4815.0.0-rc1'
fake_versioninfo = manifest_version.VersionInfo(release_tag, '39')
- self.PatchObject(gs.GSContext, 'Copy')
+ self.gs_mock = self.StartPatcher(gs_unittest.GSContextMock())
+ self.gs_mock.SetDefaultCmdResult()
self.PatchObject(cbuildbot_run._BuilderRunBase, 'GetVersionInfo',
return_value=fake_versioninfo)
self.PatchObject(toolchain, 'GetToolchainsForBoard')