Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
erp5
Commits
ecaca377
Commit
ecaca377
authored
Sep 13, 2011
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Running tests with a range of users can now be interrupted properly
parent
2bc408cb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
erp5/util/benchmark/performance_tester.py
erp5/util/benchmark/performance_tester.py
+9
-10
No files found.
erp5/util/benchmark/performance_tester.py
View file @
ecaca377
...
...
@@ -232,7 +232,7 @@ class PerformanceTester(object):
process_terminated_counter
=
0
# Ensure that SIGTERM signal (sent by terminate()) is not sent twice
do_exit
=
False
exit_status
=
0
while
process_terminated_counter
!=
len
(
process_list
):
try
:
...
...
@@ -240,7 +240,7 @@ class PerformanceTester(object):
except
KeyboardInterrupt
,
e
:
print
>>
sys
.
stderr
,
"
\
n
Interrupted by user, stopping gracefully..."
do_exit
=
True
exit_status
=
2
# An IOError may be raised when receiving a SIGINT which interrupts the
# blocking system call above and the system call should not be restarted
...
...
@@ -253,23 +253,20 @@ class PerformanceTester(object):
else
:
if
error_message
is
not
None
:
error_message_set
.
add
(
error_message
)
do_exit
=
True
exit_status
=
1
process_terminated_counter
+=
1
# In case of error or SIGINT, kill the other children because they are
# likely failing as well (especially because a process only exits after
# encountering 10 errors)
if
do_exit
:
if
exit_status
!=
0
:
for
process
in
process_list
:
if
process
.
is_alive
():
process
.
terminate
()
process
.
join
()
if
error_message_set
:
return
(
error_message_set
,
1
)
return
((),
0
)
return
(
error_message_set
,
exit_status
)
def
run
(
self
):
error_message_set
,
exit_status
=
set
(),
0
...
...
@@ -281,7 +278,8 @@ class PerformanceTester(object):
error_counter
=
0
while
(
repeat_counter
!=
self
.
_argument_namespace
.
repeat_range
and
error_counter
!=
self
.
_argument_namespace
.
max_error_number
):
error_counter
!=
self
.
_argument_namespace
.
max_error_number
and
exit_status
!=
2
):
current_user_number
=
min_user_number
while
True
:
...
...
@@ -293,7 +291,8 @@ class PerformanceTester(object):
error_message_set
.
update
(
current_error_message_set
)
if
(
current_user_number
==
max_user_number
or
error_counter
==
self
.
_argument_namespace
.
max_error_number
):
error_counter
==
self
.
_argument_namespace
.
max_error_number
or
exit_status
==
2
):
break
current_user_number
=
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment