Commit bd57f462 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos: Fix tests after the decrease of increment sleep time

parent 6e7600da
...@@ -346,7 +346,7 @@ class RunPromise(GenericPromise): ...@@ -346,7 +346,7 @@ class RunPromise(GenericPromise):
}, },
"path": "%s/my_promise.py", "path": "%s/my_promise.py",
"name": "my_promise.py", "name": "my_promise.py",
"execution-time": 0.1, "execution-time": 0.05,
"title": "my_promise" "title": "my_promise"
}""" % self.plugin_dir }""" % self.plugin_dir
state_file = os.path.join(self.partition_dir, PROMISE_RESULT_FOLDER_NAME, 'my_promise.status.json') state_file = os.path.join(self.partition_dir, PROMISE_RESULT_FOLDER_NAME, 'my_promise.status.json')
...@@ -377,7 +377,7 @@ class RunPromise(GenericPromise): ...@@ -377,7 +377,7 @@ class RunPromise(GenericPromise):
}, },
"path": "%(promise_dir)s/%(name)s.py", "path": "%(promise_dir)s/%(name)s.py",
"name": "%(name)s.py", "name": "%(name)s.py",
"execution-time": 0.1, "execution-time": 0.05,
"title": "%(name)s" "title": "%(name)s"
}""" }"""
...@@ -939,7 +939,7 @@ exit 0 ...@@ -939,7 +939,7 @@ exit 0
}, },
"path": "%s/my_promise.py", "path": "%s/my_promise.py",
"name": "my_promise.py", "name": "my_promise.py",
"execution-time": 0.1, "execution-time": 0.05,
"title": "my_promise" "title": "my_promise"
}""" % (datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S+0000'), self.plugin_dir) }""" % (datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S+0000'), self.plugin_dir)
...@@ -960,7 +960,7 @@ exit 0 ...@@ -960,7 +960,7 @@ exit 0
}, },
"path": "%(folder)s/%(name)s", "path": "%(folder)s/%(name)s",
"name": "%(name)s", "name": "%(name)s",
"execution-time": 0.1, "execution-time": 0.05,
"title": "%(name)s" "title": "%(name)s"
}""" % {'date': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S+0000'), }""" % {'date': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S+0000'),
'folder': self.legacy_promise_dir, 'folder': self.legacy_promise_dir,
......
...@@ -98,7 +98,7 @@ mkdir -p etc/service && ...@@ -98,7 +98,7 @@ mkdir -p etc/service &&
echo "#!/bin/sh" > etc/service/daemon && echo "#!/bin/sh" > etc/service/daemon &&
echo "sleep 1; touch launched echo "sleep 1; touch launched
if [ -f ./crashed ]; then if [ -f ./crashed ]; then
while true; do echo Working; sleep 0.1; done while true; do echo Working; sleep 0.05; done
else else
touch ./crashed; echo Failing; sleep 1; exit 111; touch ./crashed; echo Failing; sleep 1; exit 111;
fi" >> etc/service/daemon && fi" >> etc/service/daemon &&
...@@ -1894,7 +1894,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase): ...@@ -1894,7 +1894,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase):
with httmock.HTTMock(computer.request_handler): with httmock.HTTMock(computer.request_handler):
instance = computer.instance_list[0] instance = computer.instance_list[0]
instance.requested_state = 'started' 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') worked_file = os.path.join(instance.partition_path, 'succeed_worked')
succeed = textwrap.dedent("""\ succeed = textwrap.dedent("""\
#!/usr/bin/env sh #!/usr/bin/env sh
...@@ -1913,7 +1913,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase): ...@@ -1913,7 +1913,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase):
instance = computer.instance_list[0] instance = computer.instance_list[0]
instance.requested_state = 'started' instance.requested_state = 'started'
self.fake_waiting_time = 0.5 self.fake_waiting_time = 0.05
promise_path = os.path.join(instance.partition_path, 'etc', 'promise') promise_path = os.path.join(instance.partition_path, 'etc', 'promise')
os.makedirs(promise_path) os.makedirs(promise_path)
...@@ -1942,7 +1942,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase): ...@@ -1942,7 +1942,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase):
instance = computer.instance_list[0] instance = computer.instance_list[0]
instance.requested_state = 'started' 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') promise_path = os.path.join(instance.partition_path, 'etc', 'promise')
os.makedirs(promise_path) os.makedirs(promise_path)
...@@ -1968,7 +1968,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase): ...@@ -1968,7 +1968,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase):
instance = computer.instance_list[0] instance = computer.instance_list[0]
instance.requested_state = 'started' instance.requested_state = 'started'
self.fake_waiting_time = 0.1 self.fake_waiting_time = 0.05
for i in range(2): for i in range(2):
worked_file = os.path.join(instance.partition_path, 'succeed_%s_worked' % i) worked_file = os.path.join(instance.partition_path, 'succeed_%s_worked' % i)
...@@ -1990,7 +1990,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase): ...@@ -1990,7 +1990,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase):
with httmock.HTTMock(computer.request_handler): with httmock.HTTMock(computer.request_handler):
instance = computer.instance_list[0] instance = computer.instance_list[0]
instance.requested_state = 'started' instance.requested_state = 'started'
self.fake_waiting_time = 0.1 self.fake_waiting_time = 0.05
for i in range(2): for i in range(2):
worked_file = os.path.join(instance.partition_path, 'promise_worked_%d' % i) worked_file = os.path.join(instance.partition_path, 'promise_worked_%d' % i)
...@@ -2019,7 +2019,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase): ...@@ -2019,7 +2019,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase):
with httmock.HTTMock(computer.request_handler): with httmock.HTTMock(computer.request_handler):
instance = computer.instance_list[0] instance = computer.instance_list[0]
instance.requested_state = 'started' instance.requested_state = 'started'
self.fake_waiting_time = 0.1 self.fake_waiting_time = 0.05
for i in range(2): for i in range(2):
worked_file = os.path.join(instance.partition_path, 'promise_worked_%d' % i) worked_file = os.path.join(instance.partition_path, 'promise_worked_%d' % i)
lockfile = os.path.join(instance.partition_path, 'lock') lockfile = os.path.join(instance.partition_path, 'lock')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment