Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos-mynij-dev
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
Mynij
slapos-mynij-dev
Commits
bd53d6b6
Commit
bd53d6b6
authored
May 07, 2018
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proftpd/test: make sure we teardown even if error in setup
otherwise we leak zombie slapproxy processes
parent
1fc5a74f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
software/proftpd/test/utils.py
software/proftpd/test/utils.py
+13
-3
No files found.
software/proftpd/test/utils.py
View file @
bd53d6b6
...
@@ -68,7 +68,14 @@ class SlapOSInstanceTestCase(unittest.TestCase):
...
@@ -68,7 +68,14 @@ class SlapOSInstanceTestCase(unittest.TestCase):
@
classmethod
@
classmethod
def
setUpClass
(
cls
):
def
setUpClass
(
cls
):
try
:
cls
.
_setUpClass
()
except
:
cls
.
stopSlapOSProcesses
()
raise
@
classmethod
def
_setUpClass
(
cls
):
working_directory
=
os
.
environ
.
get
(
working_directory
=
os
.
environ
.
get
(
'SLAPOS_TEST_WORKING_DIR'
,
'SLAPOS_TEST_WORKING_DIR'
,
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'.slapos'
))
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'.slapos'
))
...
@@ -158,7 +165,10 @@ class SlapOSInstanceTestCase(unittest.TestCase):
...
@@ -158,7 +165,10 @@ class SlapOSInstanceTestCase(unittest.TestCase):
@
classmethod
@
classmethod
def
tearDownClas
s
(
cls
):
def
stopSlapOSProcesse
s
(
cls
):
# FIXME: if setUpClass fail, this is not called and leaks zombie processes
if
hasattr
(
cls
,
'_process_manager'
):
cls
.
_process_manager
.
killPreviousRun
()
cls
.
_process_manager
.
killPreviousRun
()
@
classmethod
def
tearDownClass
(
cls
):
cls
.
stopSlapOSProcesses
()
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