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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
erp5
Commits
203a89b0
Commit
203a89b0
authored
13 years ago
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All XML-RPC methods must be executed within *safe* method which allows
restart if task distribution node is down. Refactor.
parent
e267ed79
master
404msg
WebScript_viewEditor
backslash
clonedocument
cloudooooverloadtestsuite
constraintcloudooo
createuser
ctcons
datetimefieldupdate
dev
emptyvaluetext
erp5gadgetfield
fb
fix
for_erp5tristan
for_nexedierp5_before_20170823
for_nexedierp5tristan
for_testsuite
force_install
forumtest
gadgetcodemirror
guessmimetype
imw
linkintodata
mhtml
mhtmlfix
nico
ooo
ooofix
ooosp
pdf-html-safe
quote
reply
session
spadr
spadr2
testresultcomplete
tristan
tristan-performance
workaround-backup-magical-id
erp5.util-0.4.43
erp5.util-0.4.41
erp5.util-0.4.40
erp5.util-0.4.37
erp5.util-0.4.1
erp5.util-0.4
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+9
-6
No files found.
erp5/util/testnode/testnode.py
View file @
203a89b0
...
...
@@ -34,6 +34,9 @@ import time
import
xmlrpclib
import
glob
import
SlapOSControler
import
logging
DEFAULT_SLEEP_TIMEOUT
=
120
# time in seconds to sleep
class
SubprocessError
(
EnvironmentError
):
def
__init__
(
self
,
status_dict
):
...
...
@@ -43,7 +46,6 @@ class SubprocessError(EnvironmentError):
def
__str__
(
self
):
return
'Error %i'
%
self
.
status_code
from
Updater
import
Updater
supervisord_pid_file
=
None
...
...
@@ -58,8 +60,9 @@ def sigterm_handler(signal, frame):
signal
.
signal
(
signal
.
SIGTERM
,
sigterm_handler
)
import
logging
def
safeRpcCall
(
function
,
*
args
):
# XXX: this method will try infinitive calls to backend
# this can cause testnode to looked "stalled"
retry
=
64
while
True
:
try
:
...
...
@@ -188,7 +191,7 @@ branch = %(branch)s
revision
=
','
.
join
(
full_revision_list
)
if
previous_revision
==
revision
:
log
(
'Sleeping a bit'
)
time
.
sleep
(
120
)
time
.
sleep
(
DEFAULT_SLEEP_TIMEOUT
)
if
not
(
retry_software
):
continue
log
(
'Retrying install'
)
...
...
@@ -204,7 +207,7 @@ branch = %(branch)s
portal
=
xmlrpclib
.
ServerProxy
(
"%s%s"
%
(
portal_url
,
'portal_task_distribution'
),
allow_none
=
1
)
master
=
portal
.
portal_task_distribution
master
=
portal
assert
safeRpcCall
(
master
.
getProtocolRevision
)
==
1
test_result
=
safeRpcCall
(
master
.
createTestResult
,
config
[
'test_suite'
],
revision
,
[],
...
...
@@ -235,7 +238,7 @@ branch = %(branch)s
slapos_controler
=
SlapOSControler
.
SlapOSControler
(
config
,
process_group_pid_set
=
process_group_pid_set
,
log
=
log
,
slapproxy_log
=
slapproxy_log
)
for
method_name
in
(
"runSoftwareRelease"
,
"runComputerPartition"
):
for
method_name
in
(
"runSoftwareRelease"
,
"runComputerPartition"
,
):
stdout
,
stderr
=
getInputOutputFileList
(
config
,
method_name
)
slapos_method
=
getattr
(
slapos_controler
,
method_name
)
status_dict
=
slapos_method
(
config
,
...
...
@@ -288,7 +291,7 @@ branch = %(branch)s
if
remote_test_result_needs_cleanup
:
safeRpcCall
(
master
.
reportTaskFailure
,
test_result_path
,
e
.
status_dict
,
config
[
'test_node_title'
])
time
.
sleep
(
120
)
time
.
sleep
(
DEFAULT_SLEEP_TIMEOUT
)
continue
finally
:
...
...
This diff is collapsed.
Click to expand it.
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