Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: recipe_modules/bot_update/resources/bot_update.py

Issue 2382653005: Remove git lockfile flakiness on win (bot_update) (Closed)
Patch Set: Remove git lockfile flakiness on win (bot_update) Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/bot_update_coverage_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/bot_update/resources/bot_update.py
diff --git a/recipe_modules/bot_update/resources/bot_update.py b/recipe_modules/bot_update/resources/bot_update.py
index ca91dbdf98d15876634feeb65406ba9007608523..3211369667372e4ec45a6b52343120b69985a912 100755
--- a/recipe_modules/bot_update/resources/bot_update.py
+++ b/recipe_modules/bot_update/resources/bot_update.py
@@ -322,7 +322,7 @@ def gclient_configure(solutions, target_os, target_os_only, git_cache_dir):
solutions, target_os, target_os_only, git_cache_dir))
-def gclient_sync(with_branch_heads, shallow):
+def gclient_sync(with_branch_heads, shallow, break_repo_locks):
# We just need to allocate a filename.
fd, gclient_output_file = tempfile.mkstemp(suffix='.json')
os.close(fd)
@@ -334,6 +334,8 @@ def gclient_sync(with_branch_heads, shallow):
cmd += ['--with_branch_heads']
if shallow:
cmd += ['--shallow']
+ if break_repo_locks:
+ cmd += ['--break_repo_locks']
try:
call(*cmd, tries=1)
@@ -753,10 +755,14 @@ def ensure_checkout(solutions, revisions, first_sln, target_os, target_os_only,
# Ensure our build/ directory is set up with the correct .gclient file.
gclient_configure(solutions, target_os, target_os_only, git_cache_dir)
+ # Windows sometimes has trouble deleting files. This can make git commands
+ # that rely on locks fail.
+ break_repo_locks = True if sys.platform.startswith('win') else False
# Let gclient do the DEPS syncing.
# The branch-head refspec is a special case because its possible Chrome
# src, which contains the branch-head refspecs, is DEPSed in.
- gclient_output = gclient_sync(BRANCH_HEADS_REFSPEC in refs, shallow)
+ gclient_output = gclient_sync(BRANCH_HEADS_REFSPEC in refs, shallow,
+ break_repo_locks)
# Now that gclient_sync has finished, we should revert any .DEPS.git so that
# presubmit doesn't complain about it being modified.
« no previous file with comments | « no previous file | tests/bot_update_coverage_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698