run-tests.py: inherit PYTHONHASHSEED from environment if set stable
authorMads Kiilerich <madski@unity3d.com>
Tue, 29 Jan 2013 20:03:51 +0100
branchstable
changeset 18500 f0124a65e8f8
parent 18499 d07834e52b4e
child 18501 a3b2dc1aa909
run-tests.py: inherit PYTHONHASHSEED from environment if set This makes it possible to fix the seed by using for instance PYTHONHASHSEED=7 ./run-tests.py ... This can be very convenient when trying to debug problems that are influenced by hash values. Try different seed values until you find one that triggers the bad behaviour and then keep that while debugging. The value 0 will restore default Python behavior and disable randomization.
tests/run-tests.py
--- a/tests/run-tests.py	Tue Jan 29 15:25:33 2013 +0100
+++ b/tests/run-tests.py	Tue Jan 29 20:03:51 2013 +0100
@@ -1252,7 +1252,7 @@
     os.environ['no_proxy'] = ''
     os.environ['NO_PROXY'] = ''
     os.environ['TERM'] = 'xterm'
-    os.environ['PYTHONHASHSEED'] = 'random'
+    os.environ['PYTHONHASHSEED'] = os.environ.get('PYTHONHASHSEED', 'random')
 
     # unset env related to hooks
     for k in os.environ.keys():