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

Side by Side Diff: Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py

Issue 23496003: User interruption should still create results.html for run-webkit-tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rework-patchset3 Created 7 years, 3 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
OLDNEW
1 # Copyright (C) 2011 Google Inc. All rights reserved. 1 # Copyright (C) 2011 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 start_time = time.time() 113 start_time = time.time()
114 try: 114 try:
115 with message_pool.get(self, self._worker_factory, num_workers, self. _port.worker_startup_delay_secs(), self._port.host) as pool: 115 with message_pool.get(self, self._worker_factory, num_workers, self. _port.worker_startup_delay_secs(), self._port.host) as pool:
116 pool.run(('test_list', shard.name, shard.test_inputs) for shard in all_shards) 116 pool.run(('test_list', shard.name, shard.test_inputs) for shard in all_shards)
117 except TestRunInterruptedException, e: 117 except TestRunInterruptedException, e:
118 _log.warning(e.reason) 118 _log.warning(e.reason)
119 run_results.interrupted = True 119 run_results.interrupted = True
120 except KeyboardInterrupt: 120 except KeyboardInterrupt:
121 self._printer.flush() 121 self._printer.flush()
122 self._printer.writeln('Interrupted, exiting ...') 122 self._printer.writeln('Interrupted, exiting ...')
123 raise 123 # Mark execution got interrupted and return results for tests execut ed till now.
124 run_results.interrupted = True
124 except Exception, e: 125 except Exception, e:
125 _log.debug('%s("%s") raised, exiting' % (e.__class__.__name__, str(e ))) 126 _log.debug('%s("%s") raised, exiting' % (e.__class__.__name__, str(e )))
126 raise 127 raise
127 finally: 128 finally:
128 run_results.run_time = time.time() - start_time 129 run_results.run_time = time.time() - start_time
129 130
130 return run_results 131 return run_results
131 132
132 def _worker_factory(self, worker_connection): 133 def _worker_factory(self, worker_connection):
133 results_directory = self._results_directory 134 results_directory = self._results_directory
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 def split_at(seq, index): 459 def split_at(seq, index):
459 return (seq[:index], seq[index:]) 460 return (seq[:index], seq[index:])
460 461
461 num_old_per_new = divide_and_round_up(len(old_shards), max_new_shards) 462 num_old_per_new = divide_and_round_up(len(old_shards), max_new_shards)
462 new_shards = [] 463 new_shards = []
463 remaining_shards = old_shards 464 remaining_shards = old_shards
464 while remaining_shards: 465 while remaining_shards:
465 some_shards, remaining_shards = split_at(remaining_shards, num_old_p er_new) 466 some_shards, remaining_shards = split_at(remaining_shards, num_old_p er_new)
466 new_shards.append(TestShard('%s_%d' % (shard_name_prefix, len(new_sh ards) + 1), extract_and_flatten(some_shards))) 467 new_shards.append(TestShard('%s_%d' % (shard_name_prefix, len(new_sh ards) + 1), extract_and_flatten(some_shards)))
467 return new_shards 468 return new_shards
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698