[PATCH] tests: run with PYTHONHASHSEED=random

Mads Kiilerich mads at kiilerich.com
Mon Jan 14 20:19:47 CST 2013


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1358216371 -3600
# Node ID 7c1e472ebfccd39015b26987e8811714396a87b0
# Parent  404feac78b8a4ee77d13ac7b5271e1606b580797
tests: run with PYTHONHASHSEED=random

Python set and dict iteration order is in principle undefined but usually
'quite stable'. Setting PYTHONHASHSEED=random will make the iteration order
more random in Python 2.6.8 and 2.7.3 and where it has been backported. This
can thus help spot dependencies on undefined behaviour and prevent future
problems.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1251,6 +1251,7 @@ def main():
     os.environ['no_proxy'] = ''
     os.environ['NO_PROXY'] = ''
     os.environ['TERM'] = 'xterm'
+    os.environ['PYTHONHASHSEED'] = 'random'
 
     # unset env related to hooks
     for k in os.environ.keys():


More information about the Mercurial-devel mailing list