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
Amer
erp5
Commits
fd6884a6
Commit
fd6884a6
authored
Jul 30, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scalability: runScalabilityTestSuite: Add while/try in getConnection
parent
8b1ee8ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
erp5/util/scalability/runScalabilityTestSuite.py
erp5/util/scalability/runScalabilityTestSuite.py
+18
-12
No files found.
erp5/util/scalability/runScalabilityTestSuite.py
View file @
fd6884a6
...
...
@@ -19,21 +19,27 @@ 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
getConnection
(
erp5_url
,
log
):
while
True
:
try
:
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"
)
except
:
log
(
"Can't get connecttion to %s, we will retry."
%
erp5_url
)
time
.
sleep
(
10
)
pass
MAX_INSTALLATION_TIME
=
1200
def
waitFor0PendingActivities
(
erp5_url
):
def
waitFor0PendingActivities
(
erp5_url
,
log
):
start_time
=
time
.
time
()
while
MAX_INSTALLATION_TIME
>
time
.
time
()
-
start_time
:
zope_connection
=
getConnection
(
erp5_url
)
zope_connection
=
getConnection
(
erp5_url
,
log
)
zope_connection
.
request
(
'GET'
,
'/erp5/portal_activities/getMessageList'
,
headers
=
header_dict
...
...
@@ -285,7 +291,7 @@ class ScalabilityLauncher(object):
error_count
=
1
# Waiting for 0-pending activities
waitFor0PendingActivities
(
self
.
__argumentNamespace
.
erp5_url
)
waitFor0PendingActivities
(
self
.
__argumentNamespace
.
erp5_url
,
self
.
log
)
# Here call a runScalabilityTest ( placed on product/ERP5Type/tests ) ?
...
...
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