summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMartin Peres <martin.peres@linux.intel.com>2017-01-30 14:12:22 +0200
committerMartin Peres <martin.peres@linux.intel.com>2017-01-30 21:50:41 +0200
commit70e6ddbe0513476aa397cf0409dadebb8587f85c (patch)
treea1535140f8913ee94ad20d973a7bdca5efa4c91a /framework
parentbe6e9a47c9c74bd508d2b8e193dadc3b6ee387bd (diff)
framework/backends/json: always flush the metadata to the disk
This guarantees that whatever the state we are in, we can always continue the piglit run. Do not use FileBackend.__fsync as it would not do the fsync call in the non-sync mode. This change makes it easier to integrate into a CI system that is hard-reboot-resistant. Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/backends/json.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/framework/backends/json.py b/framework/backends/json.py
index 55169191d..174c0ca96 100644
--- a/framework/backends/json.py
+++ b/framework/backends/json.py
@@ -108,6 +108,10 @@ class JSONBackend(FileBackend):
with open(os.path.join(self._dest, 'metadata.json'), 'w') as f:
json.dump(metadata, f, default=piglit_encoder)
+ # Flush the metadata to the disk, always
+ f.flush()
+ os.fsync(f.fileno())
+
# make the directory for the tests
try:
os.mkdir(os.path.join(self._dest, 'tests'))