Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Lu Xu
slapos.core
Commits
bd57f462
Commit
bd57f462
authored
May 21, 2019
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos: Fix tests after the decrease of increment sleep time
parent
6e7600da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
slapos/tests/test_promise.py
slapos/tests/test_promise.py
+4
-4
slapos/tests/test_slapgrid.py
slapos/tests/test_slapgrid.py
+7
-7
No files found.
slapos/tests/test_promise.py
View file @
bd57f462
...
...
@@ -346,7 +346,7 @@ class RunPromise(GenericPromise):
},
"path": "%s/my_promise.py",
"name": "my_promise.py",
"execution-time": 0.
1
,
"execution-time": 0.
05
,
"title": "my_promise"
}"""
%
self
.
plugin_dir
state_file
=
os
.
path
.
join
(
self
.
partition_dir
,
PROMISE_RESULT_FOLDER_NAME
,
'my_promise.status.json'
)
...
...
@@ -377,7 +377,7 @@ class RunPromise(GenericPromise):
},
"path": "%(promise_dir)s/%(name)s.py",
"name": "%(name)s.py",
"execution-time": 0.
1
,
"execution-time": 0.
05
,
"title": "%(name)s"
}"""
...
...
@@ -939,7 +939,7 @@ exit 0
},
"path": "%s/my_promise.py",
"name": "my_promise.py",
"execution-time": 0.
1
,
"execution-time": 0.
05
,
"title": "my_promise"
}"""
%
(
datetime
.
utcnow
().
strftime
(
'%Y-%m-%dT%H:%M:%S+0000'
),
self
.
plugin_dir
)
...
...
@@ -960,7 +960,7 @@ exit 0
},
"path": "%(folder)s/%(name)s",
"name": "%(name)s",
"execution-time": 0.
1
,
"execution-time": 0.
05
,
"title": "%(name)s"
}"""
%
{
'date'
:
datetime
.
utcnow
().
strftime
(
'%Y-%m-%dT%H:%M:%S+0000'
),
'folder'
:
self
.
legacy_promise_dir
,
...
...
slapos/tests/test_slapgrid.py
View file @
bd57f462
...
...
@@ -98,7 +98,7 @@ mkdir -p etc/service &&
echo "#!/bin/sh" > etc/service/daemon &&
echo "sleep 1; touch launched
if [ -f ./crashed ]; then
while true; do echo Working; sleep 0.
1
; done
while true; do echo Working; sleep 0.
05
; done
else
touch ./crashed; echo Failing; sleep 1; exit 111;
fi" >> etc/service/daemon &&
...
...
@@ -1894,7 +1894,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase):
with
httmock
.
HTTMock
(
computer
.
request_handler
):
instance
=
computer
.
instance_list
[
0
]
instance
.
requested_state
=
'started'
self
.
fake_waiting_time
=
0.
1
self
.
fake_waiting_time
=
0.
05
worked_file
=
os
.
path
.
join
(
instance
.
partition_path
,
'succeed_worked'
)
succeed
=
textwrap
.
dedent
(
"""
\
#!/usr/bin/env sh
...
...
@@ -1913,7 +1913,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase):
instance
=
computer
.
instance_list
[
0
]
instance
.
requested_state
=
'started'
self
.
fake_waiting_time
=
0.5
self
.
fake_waiting_time
=
0.
0
5
promise_path
=
os
.
path
.
join
(
instance
.
partition_path
,
'etc'
,
'promise'
)
os
.
makedirs
(
promise_path
)
...
...
@@ -1942,7 +1942,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase):
instance
=
computer
.
instance_list
[
0
]
instance
.
requested_state
=
'started'
self
.
fake_waiting_time
=
0.
1
self
.
fake_waiting_time
=
0.
05
promise_path
=
os
.
path
.
join
(
instance
.
partition_path
,
'etc'
,
'promise'
)
os
.
makedirs
(
promise_path
)
...
...
@@ -1968,7 +1968,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase):
instance
=
computer
.
instance_list
[
0
]
instance
.
requested_state
=
'started'
self
.
fake_waiting_time
=
0.
1
self
.
fake_waiting_time
=
0.
05
for
i
in
range
(
2
):
worked_file
=
os
.
path
.
join
(
instance
.
partition_path
,
'succeed_%s_worked'
%
i
)
...
...
@@ -1990,7 +1990,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase):
with
httmock
.
HTTMock
(
computer
.
request_handler
):
instance
=
computer
.
instance_list
[
0
]
instance
.
requested_state
=
'started'
self
.
fake_waiting_time
=
0.
1
self
.
fake_waiting_time
=
0.
05
for
i
in
range
(
2
):
worked_file
=
os
.
path
.
join
(
instance
.
partition_path
,
'promise_worked_%d'
%
i
)
...
...
@@ -2019,7 +2019,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase):
with
httmock
.
HTTMock
(
computer
.
request_handler
):
instance
=
computer
.
instance_list
[
0
]
instance
.
requested_state
=
'started'
self
.
fake_waiting_time
=
0.
1
self
.
fake_waiting_time
=
0.
05
for
i
in
range
(
2
):
worked_file
=
os
.
path
.
join
(
instance
.
partition_path
,
'promise_worked_%d'
%
i
)
lockfile
=
os
.
path
.
join
(
instance
.
partition_path
,
'lock'
)
...
...
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