[benchmark] Benchmark_Driver: Correctly set SWIFT_DETERMINISTIC_HASHING

This commit is contained in:
Karoy Lorentey
2021-09-16 16:57:35 -07:00
parent 6cf798cd6d
commit 2fbf391b57

View File

@@ -56,6 +56,11 @@ class BenchmarkDriver(object):
"""
self.args = args
self.run_env = os.environ.copy()
# Set a constant hash seed. Some tests are highly sensitive to
# fluctuations in the number of hash collisions.
self.run_env["SWIFT_DETERMINISTIC_HASHING"] = "1"
if hasattr(args, 'libdir') and args.libdir:
# The benchmark binaries should pick up the built swift libraries
# automatically, because their RPATH should point to ../lib/swift
@@ -65,15 +70,13 @@ class BenchmarkDriver(object):
self.run_env["DYLD_LIBRARY_PATH"] = args.libdir
elif platform.system() == "Linux":
self.run_env["LD_LIBRARY_PATH"] = args.libdir
self._subprocess = _subprocess or subprocess
self.all_tests = []
self.test_number = {}
self.tests = tests or self._get_tests()
self.parser = parser or LogParser()
self.results = {}
# Set a constant hash seed. Some tests are currently sensitive to
# fluctuations in the number of hash collisions.
os.environ["SWIFT_DETERMINISTIC_HASHING"] = "1"
def _invoke(self, cmd):
return self._subprocess.check_output(