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

Side by Side Diff: frog/scripts/buildbot_annotated_steps.py

Issue 9600033: Clean up temporary directories in buildbot script. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/testing/run_selenium.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Dart frog buildbot steps 7 """Dart frog buildbot steps
8 8
9 Runs tests for the frog compiler (running on the vm or the self-hosting version) 9 Runs tests for the frog compiler (running on the vm or the self-hosting version)
10 """ 10 """
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 if system.startswith('win') and browser == 'ie': 153 if system.startswith('win') and browser == 'ie':
154 # There should not be more than one InternetExplorerDriver instance 154 # There should not be more than one InternetExplorerDriver instance
155 # running at a time. For details, see 155 # running at a time. For details, see
156 # http://code.google.com/p/selenium/wiki/InternetExplorerDriver. 156 # http://code.google.com/p/selenium/wiki/InternetExplorerDriver.
157 additional_flags += ['-j1'] 157 additional_flags += ['-j1']
158 TestStep(browser, mode, system, 'webdriver', tests, 158 TestStep(browser, mode, system, 'webdriver', tests,
159 flags + additional_flags) 159 flags + additional_flags)
160 160
161 return 0 161 return 0
162 162
163 def CleanUpTemporaryFiles(system, browser):
164 """For some browser (selenium) tests, the browser creates a temporary profile
165 on each browser session start. On Windows, generally these files are
166 automatically deleted when all python processes complete. However, since our
167 buildbot slave script also runs on python, we never get the opportunity to
168 clear out the temp files, so we do so explicitly here. Our batch browser
169 testing will make this problem occur much less frequently, but will still
170 happen eventually unless we do this.
171
172 This problem also occurs with batch tests in Firefox. For some reason selenium
173 automatically deletes the temporary profiles for Firefox for one browser,
174 but not multiple ones when we have many open batch tasks running. This
175 behavior has not been able to be reproduced outside of the buildbots.
Siggi Cherem (dart-lang) 2012/03/05 21:22:25 has not been able to be reproduced => has not been
Emily Fortuna 2012/03/05 21:50:18 Done.
176
177 Args:
178 - system: either 'linux', 'mac', or 'win7'
179 - browser: one of the browsers, see GetBuildInfo
180 """
181 if system == 'win7':
182 subprocess.Popen(['rmdir', '/S', '/Q',
183 'C:\\Users\\chrome-bot\\AppData\\Local\\Temp'], shell=True)
184 elif browser == 'ff':
185 # Note: the buildbots run as root, so we can do this without requiring a
186 # password. The command won't actually work on regular machines without
187 # root permissions.
188 p = subprocess.Popen('rm -rf /tmp/*', shell=True)
Siggi Cherem (dart-lang) 2012/03/05 21:22:25 This might be overly agressive - there might be te
Emily Fortuna 2012/03/05 21:50:18 The firefox profiles all seem to have a particular
189 p = subprocess.Popen('rm -rf /var/tmp/*', shell=True)
163 190
164 def main(): 191 def main():
165 print 'main' 192 print 'main'
166 if len(sys.argv) == 0: 193 if len(sys.argv) == 0:
167 print 'Script pathname not known, giving up.' 194 print 'Script pathname not known, giving up.'
168 return 1 195 return 1
169 196
170 arch, mode, system, browser = GetBuildInfo() 197 arch, mode, system, browser = GetBuildInfo()
171 print "arch: %s, mode: %s, system: %s, browser %s" % (arch, mode, system, 198 print "arch: %s, mode: %s, system: %s, browser %s" % (arch, mode, system,
172 browser) 199 browser)
173 if arch is None: 200 if arch is None:
174 return 1 201 return 1
175 202
176 status = BuildFrog(arch, mode, system) 203 status = BuildFrog(arch, mode, system)
177 if status != 0: 204 if status != 0:
178 print '@@@STEP_FAILURE@@@' 205 print '@@@STEP_FAILURE@@@'
179 return status 206 return status
180 207
181 if arch != 'frogium': 208 if arch != 'frogium':
182 status = TestFrog(arch, mode, system, browser, []) 209 status = TestFrog(arch, mode, system, browser, [])
183 if status != 0: 210 if status != 0:
184 print '@@@STEP_FAILURE@@@' 211 print '@@@STEP_FAILURE@@@'
185 return status 212 return status
186 213
187 status = TestFrog(arch, mode, system, browser, ['--checked']) 214 status = TestFrog(arch, mode, system, browser, ['--checked'])
188 if status != 0: 215 if status != 0:
189 print '@@@STEP_FAILURE@@@' 216 print '@@@STEP_FAILURE@@@'
190 217
218 if arch == 'frogium':
Siggi Cherem (dart-lang) 2012/03/05 21:22:25 arch == webdriver?
Emily Fortuna 2012/03/05 21:50:18 See line 51. Webdriver is not the *architecture*,
219 CleanUpTemporaryFiles(system, browser)
191 return status 220 return status
192 221
193 222
194 if __name__ == '__main__': 223 if __name__ == '__main__':
195 sys.exit(main()) 224 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | tools/testing/run_selenium.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698