Chromium Code Reviews

Side by Side Diff: scripts/slave/chromium/layout_test_wrapper.py

Issue 1914243002: Add some code to ensure that stdout is always flushed and closed to help debug layout tests hanging… (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | no next file » | 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/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """A wrapper script to run layout tests on the buildbots. 6 """A wrapper script to run layout tests on the buildbots.
7 7
8 Runs the run-webkit-tests script found in third_party/WebKit/Tools/Scripts above 8 Runs the run-webkit-tests script found in third_party/WebKit/Tools/Scripts above
9 this script. For a complete list of command-line options, pass '--help' on the 9 this script. For a complete list of command-line options, pass '--help' on the
10 command line. 10 command line.
(...skipping 132 matching lines...)
143 # directory from previous test runs (i.e.- from crashes or unittest leaks). 143 # directory from previous test runs (i.e.- from crashes or unittest leaks).
144 slave_utils.RemoveChromeTemporaryFiles() 144 slave_utils.RemoveChromeTemporaryFiles()
145 145
146 try: 146 try:
147 if options.enable_pageheap: 147 if options.enable_pageheap:
148 slave_utils.SetPageHeap(build_dir, dumprendertree_exe, True) 148 slave_utils.SetPageHeap(build_dir, dumprendertree_exe, True)
149 # Run the the tests 149 # Run the the tests
150 return slave_utils.RunPythonCommandInBuildDir(build_dir, options.target, 150 return slave_utils.RunPythonCommandInBuildDir(build_dir, options.target,
151 command) 151 command)
152 finally: 152 finally:
153 if 'win_chromium_rel_ng' in sys.argv:
154 print 'layout_test_wrapper calling stdout.flush()'
155 try:
156 sys.stdout.flush()
157 finally:
158 print 'layout_test_wrapper calling stdout.close()'
159 sys.stdout.close()
153 if options.enable_pageheap: 160 if options.enable_pageheap:
154 slave_utils.SetPageHeap(build_dir, dumprendertree_exe, False) 161 slave_utils.SetPageHeap(build_dir, dumprendertree_exe, False)
155 162
156 if options.json_test_results: 163 if options.json_test_results:
157 results_dir = options.results_directory 164 results_dir = options.results_directory
158 results_json = os.path.join(results_dir, "failing_results.json") 165 results_json = os.path.join(results_dir, "failing_results.json")
159 166
160 # If the json results file was not produced, then we produce no output 167 # If the json results file was not produced, then we produce no output
161 # file too and rely on a recipe to handle this as invalid result. 168 # file too and rely on a recipe to handle this as invalid result.
162 if os.path.isfile(results_json): 169 if os.path.isfile(results_json):
(...skipping 99 matching lines...)
262 options, args = option_parser.parse_args() 269 options, args = option_parser.parse_args()
263 options.build_dir = build_directory.GetBuildOutputDirectory() 270 options.build_dir = build_directory.GetBuildOutputDirectory()
264 271
265 # Disable pageheap checking except on Windows. 272 # Disable pageheap checking except on Windows.
266 if sys.platform != 'win32': 273 if sys.platform != 'win32':
267 options.enable_pageheap = False 274 options.enable_pageheap = False
268 return layout_test(options, args) 275 return layout_test(options, args)
269 276
270 if '__main__' == __name__: 277 if '__main__' == __name__:
271 sys.exit(main()) 278 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine