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

Unified Diff: infra/bots/common.py

Issue 1791513002: Fix compile on Windows swarming bot (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Handle AccessDenied Created 4 years, 9 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 | infra/bots/flavor/default_flavor.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/bots/common.py
diff --git a/infra/bots/common.py b/infra/bots/common.py
index 5900090dafdf8359639a622d6f6bab740abd9ede..b154ec4d6eb8812f7592ce6c1e8b47a1d05274a9 100644
--- a/infra/bots/common.py
+++ b/infra/bots/common.py
@@ -9,6 +9,7 @@
import contextlib
import math
import os
+import psutil
import shutil
import socket
import subprocess
@@ -157,15 +158,24 @@ class BotInfo(object):
self.swarm_out_dir = swarm_out_dir
os.chdir(self.skia_dir)
self.build_dir = os.path.abspath(os.path.join(self.skia_dir, os.pardir))
+ self.infrabots_dir = os.path.join(self.skia_dir, 'infra', 'bots')
+ self.home_dir = os.path.expanduser('~')
+
self.spec = self.get_bot_spec(bot_name)
self.bot_cfg = self.spec['builder_cfg']
self.out_dir = os.path.join(os.pardir, 'out')
self.configuration = self.spec['configuration']
self.default_env = {
+ 'CHROME_HEADLESS': '1',
'SKIA_OUT': self.out_dir,
'BUILDTYPE': self.configuration,
'PATH': os.environ['PATH'],
}
+ if 'Win' in self.bot_cfg['os']:
+ self.default_env['SystemRoot'] = 'C:\\Windows'
+ self.default_env['TEMP'] = os.path.join(
+ self.home_dir, 'AppData', 'Local', 'Temp')
+ self.default_env['TMP'] = self.default_env['TEMP']
self.default_env.update(self.spec['env'])
self.build_targets = [str(t) for t in self.spec['build_targets']]
self.is_trybot = self.bot_cfg['is_trybot']
@@ -251,6 +261,7 @@ class BotInfo(object):
if os.path.exists(path):
print 'Copying build product %s' % path
shutil.copy(path, dst)
+ self.cleanup()
def _run_once(self, fn, *args, **kwargs):
if not fn.__name__ in self._already_ran:
@@ -383,7 +394,7 @@ class BotInfo(object):
preAbandonGpuContext.append('--preAbandonGpuContext')
self.flavor.run(preAbandonGpuContext)
- self.flavor.cleanup_steps()
+ self.cleanup()
def perf_steps(self, got_revision, master_name, slave_name, build_number,
issue=None, patchset=None):
@@ -462,4 +473,15 @@ class BotInfo(object):
self.flavor.copy_directory_contents_to_host(
self.device_dirs.perf_data_dir, self.perf_data_dir)
+ self.cleanup()
+
+ def cleanup(self):
+ if sys.platform == 'win32':
+ # Kill mspdbsrv.exe, which tends to hang around after the build finishes.
+ for p in psutil.process_iter():
+ try:
+ if p.name == 'mspdbsrv.exe':
+ p.kill()
+ except psutil._error.AccessDenied:
+ pass
self.flavor.cleanup_steps()
« no previous file with comments | « no previous file | infra/bots/flavor/default_flavor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698