Commit aea844f4 authored by Łukasz Nowak's avatar Łukasz Nowak

Rewrite condition.

Sometimes file grown, but because of previous cache flush. So just try to read
it and check few times if expected_text is found inside.
parent d433eecf
...@@ -306,13 +306,14 @@ chmod 755 etc/run/wrapper ...@@ -306,13 +306,14 @@ chmod 755 etc/run/wrapper
self.assertSortedListEqual(os.listdir(partition_path), ['.0_wrapper.log', self.assertSortedListEqual(os.listdir(partition_path), ['.0_wrapper.log',
'.0_wrapper.log.1', 'worked', 'buildout.cfg', 'etc']) '.0_wrapper.log.1', 'worked', 'buildout.cfg', 'etc'])
tries = 10 tries = 10
expected_text = 'Signal handler called with signal 15'
while tries > 0: while tries > 0:
tries -= 1 tries -= 1
if os.path.getsize(wrapper_log) > last_size: found = expected_text in open(wrapper_log, 'r').read()
if found:
break break
time.sleep(0.2) time.sleep(0.2)
self.assertTrue('Signal handler called with signal 15' in self.assertTrue(found)
open(wrapper_log, 'r').read())
def test_one_partition_stopped_started(self): def test_one_partition_stopped_started(self):
......
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