Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
105
Merge Requests
105
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
97379162
Commit
97379162
authored
Feb 13, 2023
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/erp5/test: expose _waitForActivities utility method
parent
b2ef7dc7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
software/erp5/test/test/test_erp5.py
software/erp5/test/test/test_erp5.py
+9
-5
No files found.
software/erp5/test/test/test_erp5.py
View file @
97379162
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
import
contextlib
import
contextlib
import
datetime
import
glob
import
glob
import
http.client
import
http.client
import
json
import
json
...
@@ -450,10 +451,13 @@ class ZopeSkinsMixin:
...
@@ -450,10 +451,13 @@ class ZopeSkinsMixin:
@
classmethod
@
classmethod
def
_setUpClass
(
cls
):
def
_setUpClass
(
cls
):
super
().
_setUpClass
()
super
().
_setUpClass
()
param_dict
=
cls
.
getRootPartitionConnectionParameterDict
()
cls
.
_waitForActivities
()
# wait for ERP5 to be ready and have processed all activities
# from initial setup
@
classmethod
for
_
in
range
(
120
):
def
_waitForActivities
(
cls
,
timeout
=
datetime
.
timedelta
(
minutes
=
10
).
total_seconds
()):
"""Wait for ERP5 to be ready and have processed all activities.
"""
for
_
in
range
(
int
(
timeout
/
5
)):
with
cls
.
getXMLRPCClient
()
as
erp5_xmlrpc_client
:
with
cls
.
getXMLRPCClient
()
as
erp5_xmlrpc_client
:
try
:
try
:
if
erp5_xmlrpc_client
.
portal_activities
.
countMessage
()
==
0
:
if
erp5_xmlrpc_client
.
portal_activities
.
countMessage
()
==
0
:
...
@@ -464,7 +468,7 @@ class ZopeSkinsMixin:
...
@@ -464,7 +468,7 @@ class ZopeSkinsMixin:
pass
pass
time
.
sleep
(
5
)
time
.
sleep
(
5
)
else
:
else
:
raise
AssertionError
(
"
ERP5 is not ready
"
)
raise
AssertionError
(
"
Timeout waiting for activities
"
)
@
classmethod
@
classmethod
def
_getAuthenticatedZopeUrl
(
cls
,
path
,
family_name
=
'default'
):
def
_getAuthenticatedZopeUrl
(
cls
,
path
,
family_name
=
'default'
):
...
...
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