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

Unified Diff: chrome/test/chromedriver/run_buildbot_steps.py

Issue 14301024: [chromedriver] Clean tmp directory and kill Chrome processes before each run cycle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 7 years, 8 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 | chrome/test/chromedriver/test_expectations » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/run_buildbot_steps.py
diff --git a/chrome/test/chromedriver/run_buildbot_steps.py b/chrome/test/chromedriver/run_buildbot_steps.py
index 87f560036e795eaf47dff7abf60ed2bfd573b886..f9b8edf54a6e34382512527fb4f7117ed0335924 100755
--- a/chrome/test/chromedriver/run_buildbot_steps.py
+++ b/chrome/test/chromedriver/run_buildbot_steps.py
@@ -8,7 +8,9 @@
import optparse
import os
import subprocess
+import shutil
import sys
+import tempfile
import urllib2
import zipfile
@@ -130,6 +132,29 @@ def MaybeRelease(revision):
print '@@@STEP_FAILURE@@@'
+def KillChromes():
+ chrome_map = {
+ 'win': 'chrome.exe',
+ 'mac': 'Chromium',
+ 'linux': 'chrome',
+ }
+ if util.IsWindows():
+ cmd = ['taskkill', '/F', '/IM']
+ else:
+ cmd = ['pkill', '-9']
+ cmd.append(chrome_map[util.GetPlatformName()])
+ util.RunCommand(cmd)
+
+
+def CleanTmpDir():
+ tmp_dir = tempfile.gettempdir()
+ print 'cleaning temp directory:', tmp_dir
+ for file_name in os.listdir(tmp_dir):
+ if os.path.isdir(os.path.join(tmp_dir, file_name)):
+ print 'deleting sub-directory', file_name
+ shutil.rmtree(os.path.join(tmp_dir, file_name), True)
+
+
def main():
parser = optparse.OptionParser()
parser.add_option(
@@ -140,6 +165,10 @@ def main():
help='Chromium revision')
options, _ = parser.parse_args()
+ if not options.android_package:
+ KillChromes()
+ CleanTmpDir()
+
if options.android_package:
Download()
else:
« no previous file with comments | « no previous file | chrome/test/chromedriver/test_expectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698