From: burris Date: Sun, 1 Dec 2002 22:56:40 +0000 (+0000) Subject: slight changes to test scripts X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3b636396a5d558126f9d18ff89b3e4d5bae06079;p=quix0rs-apt-p2p.git slight changes to test scripts --- diff --git a/khashmir.py b/khashmir.py index b0b414d..a9bc5b5 100644 --- a/khashmir.py +++ b/khashmir.py @@ -290,6 +290,7 @@ def test_build_net(quiet=0, peers=24, host='localhost', pause=0): from whrandom import randrange import threading import thread + import sys port = 2001 l = [] @@ -305,19 +306,20 @@ def test_build_net(quiet=0, peers=24, host='localhost', pause=0): time.sleep(1) for peer in l[1:]: peer.app.run() - time.sleep(10) + time.sleep(3) print "adding contacts...." - for peer in l[1:]: + for peer in l: n = l[randrange(0, len(l))].node peer.addContact(host, n.port) n = l[randrange(0, len(l))].node peer.addContact(host, n.port) n = l[randrange(0, len(l))].node peer.addContact(host, n.port) - if pause: - time.sleep(.33) + if pause: + time.sleep(.33) + sys.stdout.flush() time.sleep(10) print "finding close nodes...." @@ -328,7 +330,7 @@ def test_build_net(quiet=0, peers=24, host='localhost', pause=0): f.set() peer.findCloseNodes(cb) flag.wait() - + sys.stdout.flush() # for peer in l: # peer.refreshTable() return l