Commit 8a9a8808 authored by Ivan Tyagov's avatar Ivan Tyagov

execution time of a promise can vary from 0.05 to 0.2 in a busy test machine. i…

…t makes no sense to test it

/reviewed-on nexedi/slapos.core!182
parent 497ac8e3
......@@ -180,7 +180,6 @@ class RunPromise(GenericPromise):
},
"path": "%(promise_dir)s/%(name)s.py",
"name": "%(name)s.py",
"execution-time": 0.05,
"title": "%(name)s"
}"""
......@@ -190,6 +189,10 @@ class RunPromise(GenericPromise):
with open(state_file) as f:
result_dict = json.loads(f.read())
result_dict['result'].pop('date')
# execution time of a promise can vary from 0.05 to 0.2 in a busy test machine
# it makes no sense to test it
execution_time = result_dict.pop('execution-time')
self.assertTrue(execution_time > 0.0 and execution_time <=1.0)
expected_dict = expected_result % {'promise_dir': self.plugin_dir, 'name': name}
self.assertEqual(json.loads(expected_dict), result_dict)
......
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