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
Titouan Soulard
erp5
Commits
4dbbbf59
Commit
4dbbbf59
authored
Jul 31, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scalability: runScalabilityTestSuite: Add more connection controls
parent
c43f39e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
19 deletions
+26
-19
erp5/util/scalability/runScalabilityTestSuite.py
erp5/util/scalability/runScalabilityTestSuite.py
+26
-19
No files found.
erp5/util/scalability/runScalabilityTestSuite.py
View file @
4dbbbf59
...
@@ -20,6 +20,8 @@ from erp5.util.benchmark.performance_tester import PerformanceTester
...
@@ -20,6 +20,8 @@ from erp5.util.benchmark.performance_tester import PerformanceTester
from
erp5.util
import
taskdistribution
from
erp5.util
import
taskdistribution
from
erp5.util.testnode
import
Utils
from
erp5.util.testnode
import
Utils
MAX_INSTALLATION_TIME
=
60
*
50
MAX_TESTING_TIME
=
60
MAX_GETTING_CONNECTION_TIME
=
60
*
5
MAX_GETTING_CONNECTION_TIME
=
60
*
5
def
getConnection
(
erp5_url
,
log
):
def
getConnection
(
erp5_url
,
log
):
...
@@ -42,7 +44,6 @@ def getConnection(erp5_url, log):
...
@@ -42,7 +44,6 @@ def getConnection(erp5_url, log):
time
.
sleep
(
10
)
time
.
sleep
(
10
)
raise
ValueError
(
"Cannot get new connection after %d try (for %s s)"
%
(
count
,
str
(
time
.
time
()
-
start_time
)))
raise
ValueError
(
"Cannot get new connection after %d try (for %s s)"
%
(
count
,
str
(
time
.
time
()
-
start_time
)))
MAX_INSTALLATION_TIME
=
1200
def
waitFor0PendingActivities
(
erp5_url
,
log
):
def
waitFor0PendingActivities
(
erp5_url
,
log
):
start_time
=
time
.
time
()
start_time
=
time
.
time
()
parsed
=
urlparse
.
urlparse
(
erp5_url
)
parsed
=
urlparse
.
urlparse
(
erp5_url
)
...
@@ -50,28 +51,34 @@ def waitFor0PendingActivities(erp5_url, log):
...
@@ -50,28 +51,34 @@ def waitFor0PendingActivities(erp5_url, log):
password
=
parsed
.
password
;
password
=
parsed
.
password
;
header_dict
=
{
'Authorization'
:
'Basic %s'
%
\
header_dict
=
{
'Authorization'
:
'Basic %s'
%
\
base64
.
encodestring
(
'%s:%s'
%
(
user
,
password
)).
strip
()}
base64
.
encodestring
(
'%s:%s'
%
(
user
,
password
)).
strip
()}
count
=
0
while
MAX_INSTALLATION_TIME
>
time
.
time
()
-
start_time
:
while
MAX_INSTALLATION_TIME
>
time
.
time
()
-
start_time
:
zope_connection
=
getConnection
(
erp5_url
,
log
)
zope_connection
=
getConnection
(
erp5_url
,
log
)
zope_connection
.
request
(
try
:
'GET'
,
'/erp5/portal_activities/getMessageList'
,
count
=
count
+
1
headers
=
header_dict
zope_connection
.
request
(
)
'GET'
,
'/erp5/portal_activities/getMessageList'
,
result
=
zope_connection
.
getresponse
()
headers
=
header_dict
message_list_text
=
result
.
read
()
)
message_list
=
[
s
.
strip
()
for
s
in
message_list_text
[
1
:
-
1
].
split
(
','
)]
result
=
zope_connection
.
getresponse
()
if
len
(
message_list
)
==
0
:
message_list_text
=
result
.
read
()
print
"There is no pending activities."
message_list
=
[
s
.
strip
()
for
s
in
message_list_text
[
1
:
-
1
].
split
(
','
)]
break
if
len
(
message_list
)
==
0
:
print
"There is %d pending activities"
%
len
(
message_list
)
log
(
"There is no pending activities."
)
time
.
sleep
(
5
)
break
log
(
"There is %d pending activities"
%
len
(
message_list
))
#Hack to do not take into account persistent Alarm_installMailServer acitivities
time
.
sleep
(
5
)
if
len
(
message_list
)
==
1
:
print
"1 pending activity but ok."
break
#Hack to do not take into account persistent Alarm_installMailServer acitivities
if
len
(
message_list
)
==
1
:
log
(
"1 pending activity but ok."
)
break
except
:
time
.
sleep
(
5
)
log
(
"Getting activities failed, retry."
)
raise
ValueError
(
"Cannot waitFor0PendingActivities after %d try (for %s s)"
%
(
count
,
str
(
time
.
time
()
-
start_time
)))
...
...
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