Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2021-09-10 16:34:16 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-09-10 17:48:26 +0300
commit42215d7cb8797ba5b631b9df93d07e895c4b1dda (patch)
tree04358fca94dbb15d4c2f199da76a642963408a9d /tests/performance/api
parenteb96f0cf06b9b4932979541fe4032328ad23f41f (diff)
Tests: more graceful handling of keyboard interrupting benchmarks
Leave current test result unchanged and stop executing immediately, so it can be continued.
Diffstat (limited to 'tests/performance/api')
-rw-r--r--tests/performance/api/environment.py12
-rw-r--r--tests/performance/api/graph.py2
2 files changed, 6 insertions, 8 deletions
diff --git a/tests/performance/api/environment.py b/tests/performance/api/environment.py
index 750d991ebc8..eec92cc7b6b 100644
--- a/tests/performance/api/environment.py
+++ b/tests/performance/api/environment.py
@@ -98,6 +98,8 @@ class TestEnvironment:
try:
self.call([self.cmake_executable, '.'] + self.cmake_options, self.build_dir)
self.call([self.cmake_executable, '--build', '.', '-j', jobs, '--target', 'install'], self.build_dir)
+ except KeyboardInterrupt as e:
+ raise e
except:
return False
@@ -193,17 +195,13 @@ class TestEnvironment:
lines.append(line_str)
if f:
f.write(line_str)
- except KeyboardInterrupt:
+ except KeyboardInterrupt as e:
# Avoid processes that keep running when interrupting.
proc.terminate()
+ raise e
- if f:
- f.close()
-
- # Print command output on error
+ # Raise error on failure
if proc.returncode != 0 and not silent:
- for line in lines:
- print(line.rstrip())
raise Exception("Error executing command")
return lines
diff --git a/tests/performance/api/graph.py b/tests/performance/api/graph.py
index fe4d4800894..e54adc194de 100644
--- a/tests/performance/api/graph.py
+++ b/tests/performance/api/graph.py
@@ -42,7 +42,7 @@ class TestGraph:
# Generate one graph for every device x category x result key combination.
for category, category_entries in categories.items():
- entries = sorted(category_entries, key=lambda entry: (entry.revision, entry.test, entry.date))
+ entries = sorted(category_entries, key=lambda entry: (entry.date, entry.revision, entry.test))
outputs = set()
for entry in entries: