[Erp5-report] r46016 arnaud.fontaine - /erp5/trunk/utils/erp5.utils.benchmark/src/erp5/util...
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Aug 30 10:29:58 CEST 2011
Author: arnaud.fontaine
Date: Tue Aug 30 10:29:58 2011
New Revision: 46016
URL: http://svn.erp5.org?rev=46016&view=rev
Log:
When a child exits with an error, kill the other processes
Modified:
erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/performance_tester.py
erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/process.py
Modified: erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/performance_tester.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/performance_tester.py?rev=46016&r1=46015&r2=46016&view=diff
==============================================================================
--- erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/performance_tester.py [utf8] (original)
+++ erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/performance_tester.py [utf8] Tue Aug 30 10:29:58 2011
@@ -230,8 +230,9 @@ class PerformanceTester(object):
interrupted_counter += 1
for process in process_list:
- if (not getattr(process, '_stopping', False) or
- interrupted_counter == MAXIMUM_KEYBOARD_INTERRUPT):
+ if (process.is_alive() and
+ (not getattr(process, '_stopping', False) or
+ interrupted_counter == MAXIMUM_KEYBOARD_INTERRUPT)):
process._stopping = True
process.terminate()
@@ -247,6 +248,15 @@ class PerformanceTester(object):
if error_message is not None:
error_message_set.add(error_message)
+ # In case of error, kill the other children because they are likely
+ # failing as well (especially because a process only exits after
+ # encountering 10 errors)
+ if interrupted_counter == 0:
+ for process in process_list:
+ if process.is_alive() and not getattr(process, '_stopping', False):
+ process._stopping = True
+ process.terminate()
+
if error_message_set:
return (error_message_set, 1)
Modified: erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/process.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/process.py?rev=46016&r1=46015&r2=46016&view=diff
==============================================================================
--- erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/process.py [utf8] (original)
+++ erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/process.py [utf8] Tue Aug 30 10:29:58 2011
@@ -56,7 +56,8 @@ class BenchmarkProcess(multiprocessing.P
super(BenchmarkProcess, self).__init__(*args, **kwargs)
def stopGracefully(self, *args, **kwargs):
- raise StopIteration("Interrupted by user, flushing remaining results...")
+ raise StopIteration("Interrupted by user or because of an error from "
+ "another process, flushing remaining results...")
def getBrowser(self, log_file):
info_list = tuple(self._argument_namespace.url) + \
More information about the Erp5-report
mailing list