[viff-devel] Broken unit tests
mg at lazybytes.net
Fri Jul 17 02:17:24 PDT 2009
All the tests in the buildbot are currently broken:
It is because of this change of yours:
@@ -164,6 +166,18 @@
# the Runtime, since we want everybody to wait until all
# runtimes are ready.
+ self.i = 0
+ # This loop call should ensure the queues of the parties are
+ # processed in a more or less fair manner. This is necessary
+ # because we have only one reactor for all parties here.
+ def loop_call():
+ for runtime in self.real_runtimes[self.i:] + self.real_runtimes[:self.i]:
+ self.i = (self.i + 1) % len(self.real_runtimes)
I'm very confused about what exactly
for x in xs[i:] + xs[:i]:
i = (i + 1) % len(xs)
is supposed to do? After x has run through all xs (rotated i steps),
then i will have been incremented by len(xs). But you do it mod len(xs)
and so i comes out of the loop unchanged.
The xs[i:] + xs[:i] construct is at best uncommon and at worst wasted
work. Instead of rotating the list, it should be enough to start at an
offset (i) and work your way through the list with proper wrapping at
Also, the fact that you have both self.runtimes and self.real_runtimes
smells funny :-) It's as if you're circumventing the natural scopes of
the Deferreds by storing a reference to the runtimes "on the side".
The list of Deferreds in self.runtimes ought to be enough -- can you not
add callbacks to that list if you need something to happen when the
runtimes are ready?
VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
More information about the viff-devel