From 2cf91335deff991e30d15b845ada91970fddd132 Mon Sep 17 00:00:00 2001 From: burris Date: Mon, 2 Sep 2002 21:42:16 +0000 Subject: [PATCH] test harness update --- khashmir.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/khashmir.py b/khashmir.py index 6e9b627..c29b6e7 100644 --- a/khashmir.py +++ b/khashmir.py @@ -221,13 +221,12 @@ class Khashmir(xmlrpc.XMLRPC): #------ testing -def test_build_net(quiet=0): +def test_build_net(quiet=0, peers=256, pause=1): from whrandom import randrange import thread port = 2001 l = [] - peers = 128 - + if not quiet: print "Building %s peer table." % peers @@ -251,14 +250,16 @@ def test_build_net(quiet=0): peer.addContact(n.host, n.port) n = l[randrange(0, len(l))].node peer.addContact(n.host, n.port) - time.sleep(.30) - - time.sleep(2) + if pause: + time.sleep(.30) + + time.sleep(5) print "finding close nodes...." for peer in l: peer.findCloseNodes() - time.sleep(1) + if pause: + time.sleep(1) # for peer in l: # peer.refreshTable() return l -- 2.39.5