more test predictability
authorSylvain <syt@logilab.fr>
Sat, 04 Apr 2009 15:16:37 +0200
changeset 1237 c836bdb3b17b
parent 1236 aeb46e43138d
child 1238 fa29b5b60107
more test predictability
server/msplanner.py
--- a/server/msplanner.py	Sat Apr 04 15:12:41 2009 +0200
+++ b/server/msplanner.py	Sat Apr 04 15:16:37 2009 +0200
@@ -785,10 +785,10 @@
         if secondchoice is not None:
             return secondchoice, sourceterms.pop(secondchoice)
         # priority to variable with the less solutions supported and with the
-        # most valuable refs
+        # most valuable refs. Add variable name for test predictability
         variables = sorted([(var, sols) for (var, sols) in sourceterms.items()
                             if isinstance(var, Variable)],
-                           key=lambda (v, s): (len(s), -v.valuable_references()))
+                           key=lambda (v, s): (len(s), -v.valuable_references(), v.name))
         if variables:
             var = variables[0][0]
             return var, sourceterms.pop(var)