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
Richard
erp5
Commits
2cddee38
Commit
2cddee38
authored
Jul 09, 2018
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ProcessingNodeTestCase: Remove "if 1"
parent
0152e9d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
36 deletions
+35
-36
product/ERP5Type/tests/ProcessingNodeTestCase.py
product/ERP5Type/tests/ProcessingNodeTestCase.py
+35
-36
No files found.
product/ERP5Type/tests/ProcessingNodeTestCase.py
View file @
2cddee38
...
...
@@ -214,44 +214,43 @@ class ProcessingNodeTestCase(ZopeTestCase.TestCase):
# Some tests like testDeferredStyle require that we use self.getPortal()
# instead of self.portal in order to setup current skin.
portal_activities
=
self
.
getPortal
().
portal_activities
if
1
:
if
verbose
:
ZopeTestCase
.
_print
(
'Executing pending activities ...'
)
old_message_count
=
0
start
=
time
.
time
()
count
=
1000
getMessageList
=
portal_activities
.
getMessageList
if
verbose
:
ZopeTestCase
.
_print
(
'Executing pending activities ...'
)
old_message_count
=
0
start
=
time
.
time
()
count
=
1000
getMessageList
=
portal_activities
.
getMessageList
message_list
=
getMessageList
()
message_count
=
len
(
message_list
)
while
message_count
and
not
stop_condition
(
message_list
):
if
verbose
and
old_message_count
!=
message_count
:
ZopeTestCase
.
_print
(
' %i'
%
message_count
)
old_message_count
=
message_count
portal_activities
.
process_timer
(
None
,
None
)
if
Lifetime
.
_shutdown_phase
:
# XXX CMFActivity contains bare excepts
raise
KeyboardInterrupt
message_list
=
getMessageList
()
message_count
=
len
(
message_list
)
while
message_count
and
not
stop_condition
(
message_list
):
if
verbose
and
old_message_count
!=
message_count
:
ZopeTestCase
.
_print
(
' %i'
%
message_count
)
old_message_count
=
message_count
portal_activities
.
process_timer
(
None
,
None
)
if
Lifetime
.
_shutdown_phase
:
# XXX CMFActivity contains bare excepts
raise
KeyboardInterrupt
message_list
=
getMessageList
()
message_count
=
len
(
message_list
)
# This prevents an infinite loop.
count
-=
1
if
not
count
or
message_count
and
all
(
x
.
processing_node
==
-
2
for
x
in
message_list
):
# We're about to raise RuntimeError, but maybe we've reached
# the stop condition, so check just once more:
if
stop_condition
(
message_list
):
break
error_message
=
'tic is looping forever. '
try
:
self
.
assertNoPendingMessage
()
except
AssertionError
,
e
:
error_message
+=
str
(
e
)
raise
RuntimeError
(
error_message
)
# This give some time between messages
if
count
%
10
==
0
:
portal_activities
.
timeShift
(
3
*
VALIDATION_ERROR_DELAY
)
if
verbose
:
ZopeTestCase
.
_print
(
' done (%.3fs)
\
n
'
%
(
time
.
time
()
-
start
))
# This prevents an infinite loop.
count
-=
1
if
not
count
or
message_count
and
all
(
x
.
processing_node
==
-
2
for
x
in
message_list
):
# We're about to raise RuntimeError, but maybe we've reached
# the stop condition, so check just once more:
if
stop_condition
(
message_list
):
break
error_message
=
'tic is looping forever. '
try
:
self
.
assertNoPendingMessage
()
except
AssertionError
,
e
:
error_message
+=
str
(
e
)
raise
RuntimeError
(
error_message
)
# This give some time between messages
if
count
%
10
==
0
:
portal_activities
.
timeShift
(
3
*
VALIDATION_ERROR_DELAY
)
if
verbose
:
ZopeTestCase
.
_print
(
' done (%.3fs)
\
n
'
%
(
time
.
time
()
-
start
))
self
.
abort
()
def
afterSetUp
(
self
):
...
...
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