Commit 5adf916c authored by Arnaud Fontaine's avatar Arnaud Fontaine

Ensure the file is written to the disk when publishing the results

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@45917 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5c496be7
...@@ -355,6 +355,8 @@ class BenchmarkProcess(multiprocessing.Process): ...@@ -355,6 +355,8 @@ class BenchmarkProcess(multiprocessing.Process):
self._current_repeat += 1 self._current_repeat += 1
if self._current_repeat == 5 and self._publish_method: if self._current_repeat == 5 and self._publish_method:
result_file.flush()
os.fsync(result_file.fileno())
self._publish_method(self._result_filename, result_file.tell()) self._publish_method(self._result_filename, result_file.tell())
except StopIteration, e: except StopIteration, e:
...@@ -368,6 +370,8 @@ class BenchmarkProcess(multiprocessing.Process): ...@@ -368,6 +370,8 @@ class BenchmarkProcess(multiprocessing.Process):
else: else:
if self._publish_method: if self._publish_method:
result_file.flush()
os.fsync(result_file.fileno())
self._publish_method(self._result_filename, result_file.tell()) self._publish_method(self._result_filename, result_file.tell())
self._exit_msg_queue.put(exit_msg) self._exit_msg_queue.put(exit_msg)
......
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