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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
amrani
erp5
Commits
c89b5a4d
Commit
c89b5a4d
authored
Jul 29, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scalability: runScalabilityTestSuite: Add waiting for 0-pending activities
parent
806f1c72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
erp5/util/scalability/runScalabilityTestSuite.py
erp5/util/scalability/runScalabilityTestSuite.py
+43
-0
No files found.
erp5/util/scalability/runScalabilityTestSuite.py
View file @
c89b5a4d
...
...
@@ -12,12 +12,50 @@ import json
import
logging
import
logging.handlers
import
glob
import
urlparse
from
erp5.util.benchmark.argument
import
ArgumentType
from
erp5.util.benchmark.performance_tester
import
PerformanceTester
from
erp5.util
import
taskdistribution
from
erp5.util.testnode
import
Utils
def
getConnection
(
erp5_url
):
parsed
=
urlparse
.
urlparse
(
erp5_url
)
host
=
"%s:%s"
%
(
parsed
.
hostname
,
str
(
parsed
.
port
))
if
parsed
.
scheme
==
'https'
:
return
httplib
.
HTTPSConnection
(
host
)
elif
parsed
.
scheme
==
'http'
:
return
httplib
.
HTTPConnection
(
host
)
else
:
raise
ValueError
(
"Protocol not implemented"
)
def
waitFor0PendingActivities
(
erp5_url
):
start_time
=
time
.
time
()
while
MAX_INSTALLATION_TIME
>
time
.
time
()
-
start_time
:
zope_connection
=
getConnection
(
erp5_url
)
zope_connection
.
request
(
'GET'
,
'/erp5/portal_activities/getMessageList'
,
headers
=
header_dict
)
result
=
zope_connection
.
getresponse
()
message_list_text
=
result
.
read
()
message_list
=
[
s
.
strip
()
for
s
in
message_list_text
[
1
:
-
1
].
split
(
','
)]
if
len
(
message_list
)
==
0
:
print
"There is no pending activities."
break
print
"There is %d pending activities"
%
len
(
message_list
)
time
.
sleep
(
5
)
#Hack to do not take into account persistent Alarm_installMailServer acitivities
if
len
(
message_list
)
==
0
and
testIfExist
(
"/erp5/portal_activities"
,
"Alarm_installMailServer"
):
print
"1 pending activity for 'Alarm_installMailServer'."
print
"ok."
break
# XXX: This import is required, just to populate sys.modules['test_suite'].
# Even if it's not used in this file. Yuck.
import
product.ERP5Type.tests.ERP5TypeTestSuite
...
...
@@ -246,6 +284,11 @@ class ScalabilityLauncher(object):
time
.
sleep
(
5
)
else
:
error_count
=
1
# Waiting for 0-pending activities
waitFor0PendingActivities
(
self
.
__argumentNamespace
.
erp5_url
)
# Here call a runScalabilityTest ( placed on product/ERP5Type/tests ) ?
self
.
log
(
"Test Case %s is running..."
%
(
current_test
.
title
))
try
:
...
...
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