Commits

Benoit Boissinot committed 173c17d

always add the heads

  • Participants
  • Parent commits 7e649bf

Comments (0)

Files changed (2)

File src/discovery_tonfa.py

             sample.add(n)
 
     assert sample
-    if len(sample) > 200:
-        sample = random.sample(sample, 200)
+    sample.difference_update(heads)
+    if len(sample)+len(heads) > 200:
+        sample = set(random.sample(sample, 200-len(heads)))
+    sample.update(heads)
     return sample
 
 class Client(Participant):
             self._unknown.difference_update(self._missing)
             self._unknown.difference_update(self._common)
 
-            #sample = set(sample)
-            #if not (sample ^ common) - (sample & common):
-            #    print "fast exit"
-            #    self._missing.update(self._unknown)
-            #    self._unknown.clear()
-            #    break
-
         self.writer.show("number of iterations: %i" % i)
         return self._common
 
 
         self.writer.section("traffic", quiesce=notraffic)
         actual = c.common(s)
+        print "common:", len(actual)
         self.writer.unindent()
         assertnodes(self.expected, actual)
 

File src/testing.py

 
     def testall(self):
         self.testpredefined()
-        self.testfile("../data/netbeans.dag")
+        self.testfile("../data/linux.dag")