From dd84f748d5199913cb24a71597da0e8d9bd38a2e Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Tue, 13 Dec 2022 13:45:11 -0700 Subject: [PATCH] Use hashlib.md5 for computing hashes for TEST-SERIALIZE commands Windows has some issue where `hash()` returns different values for the same string in the different child processes. md5() returns the same values in each. --- btest | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/btest b/btest index 51140292..31e9d8e3 100755 --- a/btest +++ b/btest @@ -8,6 +8,7 @@ import configparser import copy import fnmatch import glob +import hashlib import io import multiprocess as mp import multiprocess.managers as mp_managers @@ -498,7 +499,7 @@ class TestManager(mp_managers.SyncManager): if not t: continue - if t.serialize and hash(t.serialize) % self._options.threads != thread_num: + if t.serialize and int(hashlib.md5(t.serialize.encode('utf-8')).hexdigest(), 16) % self._options.threads != thread_num: # Not ours. continue