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
Léo-Paul Géneau
erp5
Commits
80b089d2
Commit
80b089d2
authored
Oct 06, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ProcessingNodeTestCase: Disable alarms for timerserver_thread loop
parent
36c5b833
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
18 deletions
+26
-18
product/ERP5Type/tests/ProcessingNodeTestCase.py
product/ERP5Type/tests/ProcessingNodeTestCase.py
+26
-18
No files found.
product/ERP5Type/tests/ProcessingNodeTestCase.py
View file @
80b089d2
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import
errno
,
logging
,
os
,
socket
,
time
import
errno
,
logging
,
mock
,
os
,
socket
,
time
import
itertools
import
itertools
from
threading
import
Thread
from
threading
import
Thread
from
UserDict
import
IterableUserDict
from
UserDict
import
IterableUserDict
...
@@ -396,20 +396,28 @@ class ProcessingNodeTestCase(ZopeTestCase.TestCase):
...
@@ -396,20 +396,28 @@ class ProcessingNodeTestCase(ZopeTestCase.TestCase):
"""
"""
import
Products.TimerService
import
Products.TimerService
timerserver_thread
=
None
# AlarmTool uses alarmNode='' as a way to bootstrap an alarm node, but
try
:
# during these tests we don't want the first node to start executing
while
not
Lifetime
.
_shutdown_phase
:
# alarms directly, because this usually cause conflicts when other
time
.
sleep
(.
3
)
# nodes register.
transaction
.
begin
()
with
mock
.
patch
(
try
:
'Products.ERP5.Tool.AlarmTool.AlarmTool.getAlarmNode'
,
self
.
portal
=
self
.
app
[
self
.
app
.
test_portal_name
]
return_value
=
'bootstrap_disabled_in_test'
):
except
(
AttributeError
,
KeyError
):
continue
timerserver_thread
=
None
self
.
_setUpDummyMailHost
()
try
:
if
not
timerserver_thread
:
while
not
Lifetime
.
_shutdown_phase
:
timerserver_thread
=
Products
.
TimerService
.
timerserver
.
TimerServer
.
TimerServer
(
time
.
sleep
(.
3
)
module
=
'Zope2'
,
transaction
.
begin
()
interval
=
0.1
,
try
:
)
self
.
portal
=
self
.
app
[
self
.
app
.
test_portal_name
]
except
KeyboardInterrupt
:
except
(
AttributeError
,
KeyError
):
pass
continue
self
.
_setUpDummyMailHost
()
if
not
timerserver_thread
:
timerserver_thread
=
Products
.
TimerService
.
timerserver
.
TimerServer
.
TimerServer
(
module
=
'Zope2'
,
interval
=
0.1
,
)
except
KeyboardInterrupt
:
pass
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