changeset 49078:186223795e4a

subsetmaker: stabilize the computation of `scratch` subset `heads` is set, order of the element are not deterministic and we need to stabilize that if we want to get reproducible results. Differential Revision: https://phab.mercurial-scm.org/D12394
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 13 Mar 2022 15:53:29 +0100
parents 5b65721a75eb
children 5a24bb7f4ed7
files contrib/perf-utils/subsetmaker.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf-utils/subsetmaker.py	Tue Jul 20 15:07:10 2021 +0200
+++ b/contrib/perf-utils/subsetmaker.py	Sun Mar 13 15:53:29 2022 +0100
@@ -102,7 +102,9 @@
     for x in range(n):
         if not heads:
             break
-        pick = rand.choice(list(heads))
+        pickable = list(heads)
+        pickable.sort()
+        pick = rand.choice(pickable)
         heads.remove(pick)
         assert pick not in selected
         selected.add(pick)