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
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
Xavier Thompson
slapos
Commits
b2792b75
Commit
b2792b75
authored
Dec 12, 2024
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/theia: Improve resiliency tests
parent
0a468034
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
software/theia/test/test_resiliency.py
software/theia/test/test_resiliency.py
+18
-3
No files found.
software/theia/test/test_resiliency.py
View file @
b2792b75
...
...
@@ -160,6 +160,19 @@ class ResilienceMixin(object):
class
ExportAndImportMixin
(
object
):
@
classmethod
def
setUpClass
(
cls
):
super
(
ExportAndImportMixin
,
cls
).
setUpClass
()
cls
.
theia_resiliency_logs
=
[]
def
fail
(
self
,
*
args
):
for
log
in
self
.
theia_resiliency_logs
:
print
(
log
)
super
(
ExportAndImportMixin
,
self
).
fail
(
*
args
)
def
tearDown
(
self
):
self
.
theia_resiliency_logs
.
clear
()
def
getExportExitfile
(
self
):
return
self
.
getPartitionPath
(
'export'
,
'srv'
,
'export-exitcode-file'
)
...
...
@@ -212,7 +225,8 @@ class ExportAndImportMixin(object):
# Call export script manually
theia_export_script
=
self
.
getPartitionPath
(
'export'
,
'bin'
,
'theia-export-script'
)
subprocess
.
check_call
((
theia_export_script
,),
stderr
=
subprocess
.
STDOUT
)
out
=
subprocess
.
check_output
((
theia_export_script
,),
stderr
=
subprocess
.
STDOUT
)
self
.
theia_resiliency_logs
.
append
(
out
)
# Check that the export exitcode file was modified
self
.
assertGreater
(
os
.
path
.
getmtime
(
exitfile
),
initial_exitdate
)
...
...
@@ -236,7 +250,8 @@ class ExportAndImportMixin(object):
# Call the import script manually
theia_import_script
=
self
.
getPartitionPath
(
'import'
,
'bin'
,
'theia-import-script'
)
subprocess
.
check_call
((
theia_import_script
,),
stderr
=
subprocess
.
STDOUT
)
out
=
subprocess
.
check_output
((
theia_import_script
,),
stderr
=
subprocess
.
STDOUT
)
self
.
theia_resiliency_logs
.
append
(
out
)
# Check that the import exitcode file was updated
self
.
assertGreater
(
os
.
path
.
getmtime
(
exitfile
),
initial_exitdate
)
...
...
@@ -566,7 +581,7 @@ class TheiaSyncMixin(TakeoverMixin, ResilienceMixin):
# XXX Accelerate cron frequency instead ?
exporter_script
=
self
.
getPartitionPath
(
'export'
,
'bin'
,
'exporter'
)
transaction_id
=
str
(
int
(
time
.
time
()))
subprocess
.
check_
call
((
exporter_script
,
'--transaction-id'
,
transaction_id
))
subprocess
.
check_
output
((
exporter_script
,
'--transaction-id'
,
transaction_id
))
takeover_url
,
_
=
self
.
_getTakeoverUrlAndPassword
()
...
...
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